Learn R Programming

mvgam (version 1.1.4)

code: Stan code and data objects for mvgam models

Description

Generate Stan code and data objects for mvgam models

Usage

code(object)

# S3 method for mvgam_prefit stancode(object, ...)

# S3 method for mvgam stancode(object, ...)

# S3 method for mvgam_prefit standata(object, ...)

Value

Either a character string containing the fully commented Stan code to fit a mvgam model or a named list containing the data objects needed to fit the model in Stan.

Arguments

object

An object of class mvgam or mvgam_prefit, returned from a call to mvgam

...

ignored

Examples

Run this code
# \donttest{
simdat <- sim_mvgam()
mod <- mvgam(y ~ s(season) +
               s(time, by = series),
             family = poisson(),
             data = simdat$data_train,
             run_model = FALSE)

# View Stan model code
stancode(mod)

# View Stan model data
sdata <- standata(mod)
str(sdata)
# }

Run the code above in your browser using DataLab