train_and_validate: Train and validate model on reported data

Description Usage Arguments Value

View source: R/spline_model.R

Description

This function fit models with selected hyperparameters on reported data and return a matrix of posterior Laplace samples.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
train_and_validate(
  reported,
  delay_dist,
  lam,
  dof,
  beta0 = NULL,
  regularization_order = 2,
  reported_val = NULL,
  end_pad_size = 0,
  fisher_approx_cov = TRUE,
  num_samps_per_ar = 10
)

Arguments

reported

An integer vector of reported cases.

delay_dist

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

lam

A fixed value for the beta parameter regularization strength.

dof

Degrees of freedom for spline basis.

beta0

(optional) Initial setting of spline parameters (before optimization)

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.

num_samps_per_ar

An integer for the number of Laplace samples per AR fit.

Value

A list of results of train and validate, including:


incidental documentation built on Sept. 16, 2020, 5:07 p.m.