SV.mle | R Documentation |
Fits a stochastic volatility model with feedback (optional) to a univariate time series of returns via quasi-MLE.
SV.mle(returns, gamma = 0, phi = 0.95, sQ = 0.1, alpha = NULL, sR0 = 1, mu1 = -3, sR1 = 2,
rho = NULL, feedback = FALSE)
returns |
single time series of returns |
gamma |
feedback coefficient - included if |
phi |
initial value of the log-volatility AR parameter (does not have to be specified) |
sQ |
initial value of the standard deviation of log-volatility noise (does not have to be specified) |
alpha |
initial value of the log-returns^2 constant parameter (does not have to be specified) |
sR0 |
initial value of the log-returns^2 normal mixture standard deviation parameter (component 0 - does not have to be specified) |
mu1 |
initial value of the log-returns^2 normal mixture mean parameter (component 1 - does not have to be specified) |
sR1 |
initial value of the log-returns^2 normal mixture standard deviation parameter (component 1 - does not have to be specified) |
rho |
correlation between the state noise and observation noise (so called "leverage"). If |
feedback |
if TRUE feedback is included in the model; default is FALSE. |
The returns are r_t
(input this).
The log-volatility process is x_t
and
y_t = \log r_t^2
.
If feedback=TRUE
, the model is
x_{t+1} = \gamma r_t + \phi x_t + \sigma w_t \qquad y_t = \alpha + x_t + \eta_t
where w_t
is standard normal noise. The observation error \eta_t
is a mixture of
two normals, N(0, \sigma_0^2)
and N(\mu_1, \sigma_1^2)
. The state
and observation noise can be correlated if \rho
is given a value between -1 and 1.
If feedback=FALSE
, \gamma
and \rho
are not included in the model.
Returned invisibly:
PredLogVol |
one-step-ahead predicted log-volatility |
RMSPE |
corresponding root MSPE |
Coefficients |
table of estimates and estimated standard errors |
In addition to the one step ahead predicted log-volatility, corresponding root MSPE, and table of estimates returned invisibly, the estimates and SEs are printed and a graph of (1) the data with the predicted log-volatility, and (2) the normal mixture are displayed in one graphic.
D.S. Stoffer
You can find demonstrations of astsa capabilities at FUN WITH ASTSA.
The most recent version of the package can be found at https://github.com/nickpoison/astsa/.
In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.
The webpages for the texts and some help on using R for time series analysis can be found at https://nickpoison.github.io/.
SV.mcmc
## Not run:
SV.mle(sp500.gr, feedback=TRUE)
SV.mle(nyse)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.