Learn R Programming

ASV (version 1.1.4)

sv_pf: Particle filter for stochastic volatility models without leverage

Description

This function computes the log likelihood given (mu, phi, sigma_eta) for stochastic volatility models without leverage (symmetric stochastic volatility models).

Usage

sv_pf(mu, phi, sigma_eta, Y, I)

Value

Logarithm of the likelihood of Y given parameters (mu, phi, sigma_eta)

Arguments

mu

parameter value such as the posterior mean of mu

phi

parameter value such as the posterior mean of phi

sigma_eta

parameter value such as the posterior mean of sigma_eta

Y

T x 1 vector (y(1),...,y(T))' of returns where T is a sample size.

I

Number of particles to approximate the filtering density.

Author

Yasuhiro Omori, Ryuji Hashimoto

References

Omori, Y., Chib, S., Shephard, N., and J. Nakajima (2007), "Stochastic volatility model with leverage: fast and efficient likelihood inference," Journal of Econometrics, 140-2, 425-449.

Takahashi, M., Omori, Y. and T. Watanabe (2022+), Stochastic volatility and realized stochastic volatility models. JSS Research Series in Statistics, in press. Springer, Singapore.

Examples

Run this code
set.seed(111)
nobs = 80; # n is often larger than 1000 in practice.
mu = 0; phi = 0.97; sigma_eta = 0.3;
h  = 0;   Y = c();
for(i in 1:nobs){
  eps = rnorm(1, 0, 1)
  eta = rnorm(1, 0, sigma_eta)
  y   = eps * exp(0.5*h)
  h   = mu + phi * (h-mu) + eta
  Y   = append(Y, y)
}
npart = 5000 
sv_pf(mu, phi, sigma_eta, Y, npart)

Run the code above in your browser using DataLab