Learn R Programming

bayesianOU (version 0.1.3)

ou_nonlinear_tmg_stan_code: Stan code for nonlinear OU model with SV and Student-t

Description

Returns the complete Stan code for the nonlinear Ornstein-Uhlenbeck model with cubic drift, stochastic volatility, and Student-t innovations. Includes numerical guardrails and parallel computation support.

Usage

ou_nonlinear_tmg_stan_code()

Arguments

Value

Character string containing Stan model code

Details

The model implements:

  • Cubic drift: \(\kappa(\theta - Y + a_3(Y-\theta)^3)\)

  • Stochastic volatility with AR(1) log-variance

  • Student-t innovations with estimated degrees of freedom

  • Hierarchical priors for sector-specific parameters

  • Optional soft constraint on TMG variable

  • Parallel likelihood computation via reduce_sum

Examples

Run this code
code <- ou_nonlinear_tmg_stan_code()
cat(substr(code, 1, 500))

Run the code above in your browser using DataLab