Stochastic Volatility Model
Constructs a simple stochastic volatility model with Gaussian errors and first order autoregressive signal.
svm(y, mu, rho, sd_ar, sigma)
y |
Vector or a |
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 |
Object of class svm
.
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))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.