Skip to content

Commit ea36c3f

Browse files
committed
bootridge: minor changes to documentation
1 parent a9fa995 commit ea36c3f

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

inst/bootridge.m

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
% Empirical Bayes Penalized Regression for univariate or multivariate outcomes,
2-
% with shrinkage tuned to minimize prediction error by .632 bootstrap-based ML.
1+
% Empirical Bayes penalized regression for univariate or multivariate outcomes,
2+
% with shrinkage tuned to minimize prediction error by .632 bootstrap.
33
%
44
% -- Function File: bootridge (Y, X)
55
% -- Function File: bootridge (Y, X, CATEGOR)
@@ -119,19 +119,19 @@
119119
%
120120
% 'bootridge (Y, X, CATEGOR, NBOOT, ALPHA, L, DEFF, SEED, TOL)' controls
121121
% the convergence tolerance for optimizing the ridge tuning constant lambda
122-
% on the log10 scale. The search terminates when the width of the current
123-
% bracket satisfies
122+
% on the log10 scale. Hyperparameter optimization terminates when the width
123+
% of the current bracket satisfies:
124124
%
125-
% log10(lambda_high) - log10(lambda_low) <= TOL.
125+
% log10(lambda_high) log10(lambda_low) < TOL.
126126
%
127-
% Thus, TOL determines the relative precision of lambda. The default value
128-
% TOL = 0.005 corresponds to approximately a 1% change in lambda (since
129-
% 10^0.005 ≈ 1.01), which is typically well below the Monte Carlo noise of
130-
% the .632 bootstrap estimate of prediction error.
127+
% Thus, TOL determines the relative (multiplicative) precision of lambda.
128+
% The default value TOL = 0.005 corresponds to approximately a 1% change in
129+
% lambda, which is typically well below the Monte Carlo noise of the .632
130+
% bootstrap estimate of prediction error.
131131
%
132132
% * If sufficient parallel resources are available (four or more workers),
133-
% the optimization uses a parallel k-section search; otherwise, a serial
134-
% golden-section search is used. The tolerance TOL applies identically
133+
% the optimization uses a parallel ksection search; otherwise, a serial
134+
% goldensection search is used. The tolerance TOL applies identically
135135
% in both cases.
136136
%
137137
% 'S = bootridge (Y, X, ...)' returns a structure containing posterior
@@ -254,13 +254,13 @@
254254
% associated with classical post-hoc adjustments [6, 7].
255255
%
256256
% PREDICTIVE OPTIMIZATION:
257-
% The ridge tuning constant is selected empirically by minimizing the .632
258-
% bootstrap estimate of prediction error [1, 2]. This aligns lambda with
259-
% minimum estimated out‑of‑sample mean squared prediction error (a Gaussian
260-
% surrogate for Kullback–Leibler predictive risk), ensuring the model is
261-
% optimized for generalizability rather than mere in-sample fit [8–10].
262-
% This lambda in turn determines the scale of the Normal ridge prior used
263-
% to shrink slope coefficients toward zero [11].
257+
% The ridge tuning constant (hyperparameter) is selected empirically by
258+
% minimizing the .632 bootstrap estimate of prediction error [1, 2]. This
259+
% aligns lambda with minimum estimated out‑of‑sample mean squared
260+
% prediction error, ensuring the model is optimized for generalizability
261+
% rather than mere in-sample fit [8–10]. This lambda in turn determines the
262+
% scale of the Normal ridge prior used to shrink slope coefficients toward
263+
% zero [11].
264264
%
265265
% CONDITIONAL VS MARGINAL PRIORS:
266266
% The ridge penalty (lambda) corresponds to a Normal prior on the
@@ -1245,7 +1245,6 @@
12451245
%! % Or we can get a obtain the design effect empirically using resampling.
12461246
%! % We already fit the model accounting for clustering, now lets fit it
12471247
%! % under I.I.D. (i.e. without clustering)
1248-
%! % Fit model with resampling under I.I.D.
12491248
%! [STATS_SRS, BOOTSTAT_SRS] = bootlm (data, {group}, 'seed', 1, 'display', ...
12501249
%! 'off', 'contrasts', 'helmert', 'method', 'bayes', 'dim', 1, ...
12511250
%! 'posthoc', 'trt_vs_ctrl');

0 commit comments

Comments
 (0)