View source: R/main-declarations.R
stan_param | R Documentation |
Create a StanParameter object
stan_param(decl, prior = "")
decl |
The Stan variable declaration from which the parameter is created. Must be an object that inherits from StanDeclaration and has a real or vector base type. |
prior |
A string of Stan code that becomes the right-hand side of the sampling statement that is the prior declaration of the parameter. The default is empty string (no prior). |
Other Stan variable declaration functions:
stan_array()
,
stan_dim()
,
stan_matrix()
,
stan_transform()
,
stan_var()
,
stan_vector()
,
stan_vector_array()
# Scalar parameter
my_par <- stan_param(stan_var("beta"), "normal(0, 1)")
print(my_par)
# Vector parameter
my_vec <- stan_vector("alpha", stan_dim("D"), lower = 0)
my_par <- stan_param(my_vec)
print(my_par)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.