cc_control: Set control parameters for case-crossover models

Description Usage Arguments Examples

View source: R/01-model-setup.R

Description

This function returns a list of control parameters suitable for input into case-crossover model setup and fitting functions. You can call it directly to see what parameters should be set and what their default values are. You can pass any of these parameters to the function directly to set their values. Arguments include:

smooth_prior: Specify the prior on the smooth terms in your model. This should be a named list with elements corresponding to each smooth term in the model. Each list element should further be a named list naming the prior and its parameters. For an explanation of available priors and their parameters, see the "priors" vignette. Note that the package will throw an error if priors aren't specified for smooth terms. There are no default priors.

linear_constraints: Specify linear constraints on your smooth model. You should input a named list of vectors. The name of the list is the name of the covariate that you want the constraint on. The length of the vector should be equal to the number of unique values of this covariate. The vector should satisfy a^T u = 0, where a is the vector and u is a SORTED (ascending) vector of unique covariate values. For help creating this list, see create_linear_constraints().

thetaaccuracy: the accuracy of the grid used for numerical integration. If there are K hyperparameters (dim(theta) = K), then thetaaccuracy^K regular gridpoints will be used. Default is 3, which is probably too low.

sparsetheta: logical. Use a sparse grid for the numerical integration of theta? This can dramatically speed up computation time. Default FALSE.

thetarange: numeric vector or matrix specifying the range of numerical integration for theta. If a vector, give a lower and upper endpoint; if dim(theta) > 1 then these are recycled, creating a cube. If dim(theta) > 1 you can also specify a rectangle by giving a matrix with one column for the lower end points and one for the upper.

optcontrol: control parameters passed to trustOptim::trust.optim(). See their vignette, which is excellent. However, the defaults here are probably fine for most problems.

Usage

1

Arguments

...

Arguments used to override the defaults output by cc_control().

Examples

1
cc_control(smooth_prior = list(z = list(prior = "pc_prec",params = c(u = 3,a = 1))))

awstringer1/casecrossover documentation built on March 11, 2021, 4:41 a.m.