This function holds the regularization parameter value fixed and scans spline degrees of freedom.
scan_spline_dof(
reported,
delay_dist,
dof_grid,
method = "bic",
lam = 0,
regularization_order = 2,
reported_val = NULL,
end_pad_size = 0,
fisher_approx_cov = FALSE
)
An integer vector of reported cases.
A positive vector that sums to one, which describes the delay distribution.
An integer vector of degrees of freedom for the spline basis.
Metric to choose "best" dof: 'aic', 'bic', 'val'. If method='val', reported_val must be non NULL and match reported size.
A fixed value for the beta parameter regularization strength.
An integer (typically 0, 1, 2), indicating differencing order for L2 regularization of spline parameters. Default is 2 for second derivative penalty.
Validation time series of equal size to reported vector for use with 'val' method. Default is NULL.
And integer number of steps the spline is defined beyond the final observation.
A flag to use either the Fisher Information (TRUE) or the Hessian (FALSE) to approx posterior covariance over parameters.
A list of degree of freedom fit statistics:
best_dof = best degrees of freedom
dof_resdf = data frame of fit statistics (lambda, dof, aic, bic, val_lls, train_lls)