Why Grid Design Matters
A PRS method can produce different scores under different choices of p-value threshold, shrinkage strength, or prior settings. Tuning requires comparing candidate settings using validation data, but every extra candidate can add substantial computation, particularly when a method is fitted repeatedly within a validation procedure. A grid that is too coarse can miss useful regions; one that is too dense can spend resources comparing settings that are effectively indistinguishable.
Grid design is therefore a balance between coverage and resolution. Coverage means including a plausible range of settings. Resolution means having enough candidates within that range to locate meaningful changes in validation performance. The aim is not to make the grid large, but to make it informative and computationally feasible.
The choice of validation data and protection against test-set reuse are addressed in the earlier material on choosing score hyperparameters without reusing test data and nested validation. Here, assume that the validation design is fixed and that each candidate is evaluated using the same prespecified procedure. The discovery data, LD inputs, phenotype definition, covariates, sample eligibility rules, and validation splits should also be held fixed across candidates unless one of these is itself the intended object of study. Changing them along with the hyperparameters makes comparisons difficult to interpret.
Build the Grid Around the Parameter
Different PRS parameters have different scales and meanings. A p-value threshold \(t\) determines which variants are eligible for a score; changing \(t\) can change the number of variants substantially. A shrinkage parameter may control how strongly estimated effects are pulled toward zero, but its numerical direction and scale depend on the method. A prior may involve several settings, such as a probability \(q\) that an effect is nonzero and a variance \(\tau^2\) for nonzero effects. A useful grid reflects those distinctions rather than applying one arbitrary sequence to every parameter.
For p-value thresholds, include values spanning orders of magnitude when plausible choices do so. A list such as \(5\times10^{-8}, 10^{-6}, 10^{-4}, 0.01, 0.1, 1\) samples multiplicatively spaced regions more usefully than six equally spaced numbers between zero and one. Include a permissive endpoint only when it corresponds to a meaningful candidate, such as allowing all available variants. Record how many variants pass each threshold in the discovery data: that count helps show what the grid actually changes.
For a positive shrinkage strength \(\lambda\), a logarithmic grid is often sensible when the effect of changing \(\lambda\) is relative rather than additive. This is not a universal rule: inspect the method's parameterization and use its documented interpretation. In some procedures, larger values mean stronger shrinkage; in others, the supplied parameter may instead represent a quantity such as a retained signal fraction. Do not compare numerical values across different methods as though they had the same meaning.
For prior settings, first identify which combinations are valid for the model. If \(q\) denotes a nonzero-effect probability and \(\tau^2\) a variance conditional on a nonzero effect, it may be important to vary them jointly: the same variance can have different consequences under different values of \(q\). A full Cartesian grid can become large quickly. Use a modest set of scientifically plausible combinations, and avoid combinations that the model does not permit or that are incompatible with the scale used to define the prior.
Worked Example: Spacing a Shrinkage Grid
Suppose a hypothetical method uses a positive penalty parameter \(\lambda\), with larger values producing stronger shrinkage. Prior knowledge suggests that useful values could range from \(0.01\) to \(100\). We want five candidates that cover this range with equal multiplicative spacing.
There are four intervals between five candidates. The endpoint ratio is \(100/0.01=10{,}000\). If the common multiplicative step is \(r\), then \(r^4=10{,}000\), so \(r=10\). The grid is therefore \(0.01, 0.1, 1, 10, 100\).
This grid changes \(\lambda\) by the same factor at each step, rather than by the same absolute amount. If validation performance improves at \(1\) and \(10\), the next refinement can add candidates between them; if performance is already poor at both extremes, a different range may be needed. The calculation does not establish that the endpoints are appropriate: they must still be justified for the method.
Budget the Fits Before Running Them
A grid's computational cost is determined not only by its number of candidates but also by the validation procedure. If there are \(K\) candidate configurations and each is evaluated in \(F\) validation folds, the basic number of candidate-fold evaluations is \(KF\). If each evaluation requires a separate model fit, this is also the number of fits. When the evaluation is nested, outer repetitions multiply the work: with \(O\) outer folds, a simple count is \(OKF\) inner candidate-fold evaluations, before counting any final refits or method-specific iterations.
This count is a planning tool, not a guarantee of runtime. Some settings may reuse intermediate computations, while others may require expensive fitting. If computation is limited, reduce redundant candidates or use a staged search: first assess a coarse grid, then refine a small region using the permitted training and validation data. Any refinement must follow the validation design; the outer test data must not influence which candidates are added or selected.
Worked Example: Checking a Fit Budget
A hypothetical analysis will compare six p-value thresholds and four shrinkage strengths. Each of the \(6\times4=24\) configurations is evaluated in five inner folds, and the validation procedure has four outer folds.
Within one outer fold, the number of candidate-fold evaluations is \(24\times5=120\). Across all four outer folds, the total is \(4\times120=480\) candidate-fold evaluations. If each evaluation fits the score method once, that means 480 fits, not including any final refits. The grid is feasible only if the available computing resources can handle those fits.
If the budget allows only 240 such evaluations, one option is to reduce the grid to 12 configurations: for example, retain six thresholds but test two shrinkage values in the first pass. Then the count is \(4\times(12\times5)=240\). This coarser search may miss a useful setting, so a second, targeted pass should be planned only if the validation design permits it.
Use Validation Patterns, Not Just the Highest Entry
Let \(V(\theta)\) denote the prespecified validation criterion, with larger values defined to be better. The numerical maximum is a natural candidate, but it can be misleading when it is an isolated peak surrounded by poorer values. A useful grid assessment asks whether high values persist across nearby settings, whether the best value lies at the edge of the grid, and whether the pattern is plausible for the method.
One transparent descriptive rule is to define a practical tolerance \(\delta\) in advance and call configurations near-optimal when they satisfy \(V(\theta)\geq V_{\max}-\delta\), where \(V_{\max}\) is the highest observed validation value. The tolerance is in the units of the validation criterion and should represent a difference small enough not to change the practical decision. It is not a probability statement, a test of equality, or a substitute for evaluating validation uncertainty. In particular, a difference smaller than \(\delta\) does not prove that the settings perform identically.
A robust choice is often one that belongs to a broad near-optimal region, rather than a lone point with the largest recorded value. If several candidates are practically indistinguishable, a simpler or more stable setting may be preferable, provided that preference is specified transparently. When the maximum occurs at a grid boundary, the grid may not cover the useful region; expand or refine it using permitted data rather than declaring the boundary best by default.
Worked Example: Finding a Stable Region for Shrinkage
In a hypothetical validation exercise, a continuous phenotype is evaluated using validation \(R^2\), with larger values preferred. A method's documented parameterization makes larger \(\lambda\) correspond to stronger shrinkage. The results are:
| \(\lambda\) | 0.1 | 0.3 | 1 | 3 | 10 |
|---|---|---|---|---|---|
| Validation \(R^2\) | 0.101 | 0.109 | 0.112 | 0.111 | 0.104 |
The maximum is \(V_{\max}=0.112\), at \(\lambda=1\). Suppose the analysis prespecified \(\delta=0.005\) \(R^2\) units. The near-optimal cutoff is \(0.112-0.005=0.107\). The candidates with validation \(R^2\) at least \(0.107\) are \(0.3\), \(1\), and \(3\), with values \(0.109\), \(0.112\), and \(0.111\), respectively.
The best value is at \(\lambda=1\), but the nearby candidates also perform well under this rule. That pattern supports treating the region from \(0.3\) to \(3\) as a stable candidate region, rather than interpreting \(1\) as uniquely optimal. A practical selection could use \(\lambda=1\) as its center, while reporting that nearby settings had similar validation results. This describes the observed grid; it does not establish that the population prediction performances are equal.
Joint Prior Grids and Their Interpretation
When prior settings act together, inspect the results in combinations rather than selecting each parameter independently. For instance, selecting the best \(q\) while holding an arbitrary \(\tau^2\) fixed can miss an interaction: the preferred nonzero-effect probability may depend on the conditional effect variance. A compact table or heat map can reveal whether performance changes smoothly across combinations, whether a ridge of good values exists, or whether one isolated combination dominates.
Worked Example: Comparing Joint Prior Settings
Consider a hypothetical model in which \(q\) is the prior probability that an effect is nonzero and \(\tau^2\) is the variance of effects conditional on being nonzero. The settings are on the standardized effect scale. Validation \(R^2\) is the prespecified criterion, and larger values are better.
| \(q\) | \(\tau^2=0.01\) | \(\tau^2=0.04\) | \(\tau^2=0.16\) |
|---|---|---|---|
| 0.01 | 0.081 | 0.086 | 0.080 |
| 0.05 | 0.085 | 0.093 | 0.091 |
| 0.10 | 0.079 | 0.090 | 0.087 |
The largest observed value is \(0.093\), at \(q=0.05\) and \(\tau^2=0.04\). With a prespecified tolerance \(\delta=0.005\), the near-optimal cutoff is \(0.093-0.005=0.088\). Three combinations meet it: \((0.05,0.04)\) with \(0.093\), \((0.05,0.16)\) with \(0.091\), and \((0.10,0.04)\) with \(0.090\).
These results suggest a region of reasonably high validation performance around the central setting, rather than a lone winning pair. The combinations should still be interpreted according to the model's prior definition: the table does not imply that \(q\) and \(\tau^2\) can be tuned separately or that these numerical values transfer to a different model or effect scale.
Diagnostics, Alternatives, and Limitations
Several patterns indicate that a grid needs attention. A best candidate at the smallest or largest value can signal an inadequate range. A sharp, isolated peak may reflect a genuinely sensitive method, but it can also result from instability in the validation results; do not respond by claiming certainty from a single maximum. A flat surface suggests that extra grid density may add little decision value. Unexpected discontinuities can arise from implementation errors, inconsistent variant sets, or changes in preprocessing across candidates. Check that candidates were fitted successfully and that all comparisons use the same validation design.
An exhaustive grid is easy to audit and useful when only a few settings are involved, but its cost grows multiplicatively with the number of parameters. A staged coarse-to-fine grid can use computation more efficiently when refinement is confined to allowed training and validation data. Random search samples a larger space without evaluating every combination and can be useful when there are many parameters, but it may leave important regions unexplored and can be harder to reproduce unless the sampling plan and random seed are recorded. More automated search strategies can reduce manual grid construction, but they do not remove the need to define valid ranges, control data reuse, or inspect the resulting search region.
No grid can compensate for a poorly chosen validation design, incompatible LD information, or a mismatch between the phenotype and the intended prediction target. Nor does the best observed candidate guarantee best performance in a new cohort. The purpose of the grid is to make a disciplined comparison over a defensible set of choices; conclusions remain limited by the candidates included and the validation data used.
Check Your Understanding
Try each problem, then compare your reasoning with the solutions below.
- A positive parameter is plausibly between \(0.001\) and \(10\). Construct a five-point grid with equal multiplicative spacing.
- A grid has 8 configurations, 4 inner folds, and 3 outer folds. How many candidate-fold evaluations are required, ignoring final refits?
- Validation values for four adjacent settings are \(0.210, 0.218, 0.217,\) and \(0.211\). The maximum is \(0.218\), and the prespecified tolerance is \(0.003\). Which settings are near-optimal, and what pattern do they suggest?
- Why can selecting a prior probability at one fixed variance and then selecting a variance at that chosen probability fail to find the best joint setting?
Solutions. (1) There are four intervals, and the endpoint ratio is \(10/0.001=10{,}000\). The multiplicative step is \(10{,}000^{1/4}=10\), giving \(0.001, 0.01, 0.1, 1, 10\). (2) The count is \(8\times4\times3=96\) candidate-fold evaluations. (3) The cutoff is \(0.218-0.003=0.215\), so the second and third settings, with values \(0.218\) and \(0.217\), are near-optimal. Their adjacent high values suggest a small plateau rather than a single isolated maximum. (4) The preferred probability can depend on the variance, so the best pair may not be found by optimizing each parameter conditionally in sequence. A joint grid evaluates combinations directly and can expose that dependence.