add_stancode: Add Stan code to the generated quantities block

View source: R/add_stancode.R

add_stancodeR Documentation

Add Stan code to the generated quantities block

Description

Add Stan code to the generated quantities block

Usage

add_stancode(scode_raw, new_code, block)

Arguments

scode_raw

Stan code generated by brms::make_stancode().

new_code

A character string containing Stan code to add to the generated quantities block

block

Specify the code block to modify.

Value

A Stan program of class brmsmodel.

Examples

library("brms")
data <- read.csv(paste0(system.file("extdata", package = "bgamcar1"), "/data_car1.csv"))
scode <- make_stancode(bf(y ~ ar(time = x)), data)
add_stancode(scode, "\n  // add new code here:", block = "generated quantities")

bentrueman/bgamcar1 documentation built on July 6, 2024, 11:16 p.m.