Learn R Programming

bayesianOU (version 0.1.3)

plot_sv_evolution: Plot stochastic volatility evolution

Description

Displays the estimated volatility path for a selected sector.

Usage

plot_sv_evolution(results, sector = 1)

Value

NULL invisibly. Produces a base R plot as side effect.

Arguments

results

List returned by fit_ou_nonlinear_tmg

sector

Integer. Sector index to plot. Default 1.

Examples

Run this code
# \donttest{
# 1. Create mock data (Volatility must be positive)
T_obs <- 50
sigma_mat <- matrix(exp(rnorm(T_obs * 2)), nrow = T_obs, ncol = 2)

# 2. Wrap in list structure
results_mock <- list(
  sv = list(
    h_summary = list(
      sigma_t = sigma_mat
    )
  )
)

# 3. Plot sector 1
plot_sv_evolution(results_mock, sector = 1)
# }

Run the code above in your browser using DataLab