model_code: Extract Stan code

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

  • model_code(stanmodel): method

  • model_code(stanfit): Extract code from a model fit

Examples


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


RStanTVA documentation built on April 16, 2025, 5:10 p.m.