stan_param: Create a StanParameter object

View source: R/main-declarations.R

stan_paramR Documentation

Create a StanParameter object

Description

Create a StanParameter object

Usage

stan_param(decl, prior = "")

Arguments

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).

See Also

Other Stan variable declaration functions: stan_array(), stan_dim(), stan_matrix(), stan_transform(), stan_var(), stan_vector(), stan_vector_array()

Examples

# 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)

jtimonen/odemodeling documentation built on Sept. 15, 2024, 4:29 a.m.