fit_stan_models: Fit and summarise models

Description Usage Arguments Value See Also

View source: R/fit_stan_models.R

Description

Fit and summarise models

Usage

1
2
3
4
5
6
fit_stan_models(ModelReadyDataSpec, PreCompile = TRUE,
  BaseLineModelsNames = NULL, FileName = "ModelResults", SubFiles = 4,
  Folder = "results", Path = ".", ReRunAnalysis = FALSE, verbose = TRUE,
  Cores = NULL, Iterations = 10000, BurnIn = 5000, Alpha = 0.99,
  Treedepth = 10, UpdateAlpha = 0.99999, HandleDLLs = FALSE,
  UpdateTreedepth = 20)

Arguments

ModelReadyDataSpec

A dataframe of data ready for modelling

PreCompile

Logical, defaults to TRUE. Should a subset of models be precompiled (specified with BaseLineModelNames) for the first vaccination scheme and population?

BaseLineModelsNames

A character string of baseline model names.

FileName

A character string to use as the file name for the results. Defaults to ModelResults.

SubFiles

Numeric, defaults to 4. The number of subfiles to split the results into. Results are saved as ModelResults1 etc. This must be smaller or equal to the number of models to be fitted.

Folder

Character string to use as the folder name for the results. Defaults to "results"

Path

Character string specifying the path to the results folder. Defaults to ".".

ReRunAnalysis

Logical, default to FALSE. Should the analysis be rerun.

verbose

Logical defaults to FALSE. Should progress messages be printed.

Cores

Numeric, defaults to the number of cores available minus 1. How many cores to use for the analysis.

Iterations

Numeric, the number of iterations to use for the MCMC sampler. Defaults to 10000.

BurnIn

Numeric, the number of iterations to use for the burn in. Defaults to 5000.

Alpha

Numeric, set the adaptive alpha value for the MCMC. Defaults to 0.99

Treedepth

Numeric, set the maximum tree depth. Defaults to 10.

UpdateAlpha

Numeric, set an updated alpha for models that have failed to fit. Defaults to 0.99999.

HandleDLLs

Logical, defaults to FALSE. Enables tracking and unloading of Stan DLL objects. If not reachng R's DLL cap then this is not required.

UpdateTreedepth

Numeric, set the updated maximum tree depth for models that have failed to fit.

Value

A dataframe of summarised results for the models specified to be fitted in the input dataframe.

See Also

clear_user_DLL Base_Model summarise_model_fit


seabbs/DirectEffBCGPolicyChange documentation built on Dec. 14, 2019, 9:24 p.m.