Learn R Programming

ASV (version 1.1.4)

asv_apf: Auxiliary particle filter for stochastic volatility models with leverage

Description

The function computes the log likelihood given (mu, phi, sigma_eta, rho) for stochastic volatility models with leverage (asymmetric stochastic volatility models).

Usage

asv_apf(mu, phi, sigma_eta, rho, Y, I)

Value

Logarithm of the likelihood of Y given parameters (mu, phi, sigma_eta, rho) using the auxiliary particle filter by Pitt and Shephard (1999).

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

rho

parameter value such as the posterior mean of rho

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

Pitt, M. K., and N. Shephard (1999), "Filtering via simulation: Auxiliary particle filters." Journal of the American statistical association 94, 590-599.

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; rho = -0.3;
h  = 0;   Y = c();
for(i in 1:nobs){
  eps = rnorm(1, 0, 1)
  eta = rho*sigma_eta*eps + sigma_eta*sqrt(1-rho^2)*rnorm(1, 0, 1)
  y   = eps * exp(0.5*h)
  h   = mu + phi * (h-mu) + eta
  Y   = append(Y, y)
}
npart = 1000 
asv_apf(mu, phi, sigma_eta, rho, Y, npart)

Run the code above in your browser using DataLab