Infer parameter data structure from Stan's parameter names
Source:R/stan2r.R
get_stan_param_info.Rd
This function is used in stom::extract2()
for inferring parameter structure
from Stan model outputs.
Examples
p_scalar = c( "alpha", "beta" )
p_1d = c( "x[1]", "x[2]" )
p_2d = c("y[1,1]", "y[2,1]", "y[1,2]", "y[2,2]")
p_3d = c("z[1,1,1]", "z[2,1,1]", "z[1,2,1]", "z[2,2,1]", "z[1,1,2]", "z[2,1,2]", "z[1,2,2]", "z[2,2,2]")
params = c( p_scalar, p_1d, p_2d, p_3d )
get_stan_param_info(params)
#> Error in get_stan_param_info(params): could not find function "get_stan_param_info"