Skip to contents

The input list can be nested in arbitrary levels, as long as the names at the last level matches those used in the corresponding Stan model.

Usage

get_sim_param_info(lst)

Arguments

lst

List. A list of parameter values from the simulation. Refer to system.file("cases", "treatment_dynamics", "2-varying-effect-model", "simulation.R", package="stom") for the data structure of the input. It should match the structure of sim_data()$params.

Value

A list of parameters with their dimension info.

Examples

fp = system.file("cases", "treatment_dynamics", "1-simplified-normal-model", "simulation.R", package="stom")
source(fp)
d = sim_data()
str(d$params)
#> List of 7
#>  $ B_TE : num [1:3] 0.5 1 2
#>  $ B_ED : num 1.5
#>  $ B_AE : num 1
#>  $ B_AD : num 0.8
#>  $ E    : num [1:30, 1:4] -0.103 -1.087 -3.829 -2.032 -2.71 ...
#>  $ I    : num [1:20] -3 -2.68 -2.37 -2.05 -1.74 ...
#>  $ kappa: num [1:5] -2.4 -1.1 0 1.1 2.4
get_sim_param_info(d$params)
#> $B_TE
#> $B_TE$cls
#> [1] "vector"
#> 
#> $B_TE$dim
#> [1] 3
#> 
#> 
#> $B_ED
#> $B_ED$cls
#> [1] "vector"
#> 
#> $B_ED$dim
#> [1] 1
#> 
#> 
#> $B_AE
#> $B_AE$cls
#> [1] "vector"
#> 
#> $B_AE$dim
#> [1] 1
#> 
#> 
#> $B_AD
#> $B_AD$cls
#> [1] "vector"
#> 
#> $B_AD$dim
#> [1] 1
#> 
#> 
#> $E
#> $E$cls
#> [1] "matrix"
#> 
#> $E$dim
#> [1] 30  4
#> 
#> 
#> $I
#> $I$cls
#> [1] "vector"
#> 
#> $I$dim
#> [1] 20
#> 
#> 
#> $kappa
#> $kappa$cls
#> [1] "vector"
#> 
#> $kappa$dim
#> [1] 5
#> 
#>