Skip to contents

StanModule Object and Constructor Function

Usage

StanModule(x = "", ...)

Arguments

x

(string) file path to a Stan program or a character vector of Stan code to be parsed.

...

additional arguments passed to the constructor.

Value

A StanModule object.

Slots

functions

(character)
the functions block.

data

(character)
the data block.

transformed_data

(character)
the transformed_data block.

parameters

(character)
the parameters block.

transformed_parameters

(character)
the transformed_parameters block.

model

(character)
the model block.

generated_quantities

(character)
the generated_quantities block.

Examples

code <- "
parameters {
  real x;
}
model {
  x ~ normal(0, 1);
}
"
StanModule(code)
#> 
#>    StanModule Object with components:
#>        parameters
#>        model 
#>