model_code {RStanTVA}R Documentation

Extract Stan code

Description

Extracts the Stan code from a StanTVA model object.

Usage

model_code(object, type)

## S4 method for signature 'stanmodel'
model_code(object, type = c("stan", "stan2", "cpp"))

## S4 method for signature 'stanfit'
model_code(object, type)

Arguments

object

A StanTVA model object or fit.

type

The type of code to return (stan: formatted StanTVA, stan2: ready-to-compile Stan code, cpp: generated C++ code).

Value

A RStanTVA model code object (stan), or a string containing the code (stan2 or cpp).

Methods (by class)

Examples


model <- stantva_model(locations = 2)
model_code(model)


[Package RStanTVA version 0.3.0 Index]