Description Usage Arguments Value

This function holds degrees of freedom fixed and scans regularization parameter values.

1 2 3 4 5 6 7 8 9 10 11 12 | ```
scan_spline_lam(
reported,
delay_dist,
lam_grid,
method = "val",
percent_thresh = 2,
dof = 10,
regularization_order = 2,
reported_val = NULL,
end_pad_size = 0,
fisher_approx_cov = TRUE
)
``` |

`reported` |
An integer vector of reported cases. |

`delay_dist` |
A positive vector that sums to one, which describes the delay distribution. |

`lam_grid` |
A vector of regularization strengths to scan. |

`method` |
Metric to choose "best" dof: 'aic', 'bic', 'val'. If method='val', reported_val must be non NULL and match reported size. |

`percent_thresh` |
If using validation likelihood to select best, the largest (strongest) lambda that is within 'percent_thresh' of the highest validation lambda will be selected. Default is 2. Must be greater than 0. |

`dof` |
Degrees of freedom for spline basis. |

`regularization_order` |
An integer (typically 0, 1, 2), indicating differencing order for L2 regularization of spline parameters. Default is 2 for second derivative penalty. |

`reported_val` |
Validation time series of equal size to reported vector for use with 'val' method. Default is NULL. |

`end_pad_size` |
And integer number of steps the spline is defined beyond the final observation. |

`fisher_approx_cov` |
A flag to use either the Fisher Information (TRUE) or the Hessian (FALSE) to approx posterior covariance over parameters. |

List of outputs:

best_lam = best lambda

lam_resdf = data frame of fit statistics (lambda, dof, aic, bic, val_lls, train_lls)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.