Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

svm

Stochastic Volatility Model


Description

Constructs a simple stochastic volatility model with Gaussian errors and first order autoregressive signal.

Usage

svm(y, mu, rho, sd_ar, sigma)

Arguments

y

Vector or a ts object of observations.

mu

Prior for mu parameter of transition equation.

rho

prior for autoregressive coefficient.

sd_ar

Prior for the standard deviation of noise of the AR-process.

sigma

Prior for sigma parameter of observation equation, internally denoted as phi. Ignored if mu is provided. Note that typically parametrization using mu is preferred due to better numerical properties and availability of better Gaussian approximation. Most notably the global approximation approach does not work with sigma parameterization as sigma is not a parameter of the resulting approximate model.

Value

Object of class svm.

Examples

data("exchange")
exchange <- exchange[1:100] # faster CRAN check
model <- svm(exchange, rho = uniform(0.98,-0.999,0.999),
 sd_ar = halfnormal(0.15, 5), sigma = halfnormal(0.6, 2))

obj <- function(pars) {
   -logLik(svm(exchange, rho = uniform(pars[1],-0.999,0.999),
   sd_ar = halfnormal(pars[2],sd=5),
   sigma = halfnormal(pars[3],sd=2)), particles = 0)
}
opt <- nlminb(c(0.98, 0.15, 0.6), obj, lower = c(-0.999, 1e-4, 1e-4), upper = c(0.999,10,10))
pars <- opt$par
model <- svm(exchange, rho = uniform(pars[1],-0.999,0.999),
  sd_ar = halfnormal(pars[2],sd=5),
  sigma = halfnormal(pars[3],sd=2))

bssm

Bayesian Inference of Non-Linear and Non-Gaussian State Space Models

v1.1.4
GPL (>= 2)
Authors
Jouni Helske [aut, cre] (<https://orcid.org/0000-0001-7130-793X>), Matti Vihola [aut] (<https://orcid.org/0000-0002-8041-7222>)
Initial release
2021-04-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.