Description Usage Arguments Details Value Author(s) References Examples
A collection and description of functions to model
the GARCH(1,1) price paths which underly Heston and
Nandi's option pricing model.
The functions are:
hngarchSim | Simulates a Heston-Nandi Garch(1,1) process, |
hngarchFit | MLE for a Heston Nandi Garch(1,1) model, |
hngarchStats | True moments of the log-Return distribution, |
print.hngarch | Print method, |
summary.hngarch | Diagnostic summary. |
1 2 3 4 5 6 7 8 9 10 | hngarchSim(model, n, innov, n.start, start.innov, rand.gen, ...)
hngarchFit(x, model = list(lambda = -0.5, omega = var(x), alpha =
0.1 * var(x), beta = 0.1, gamma = 0, rf = 0), symmetric = TRUE,
trace = FALSE, title = NULL, description = NULL, ...)
hngarchStats(model)
## S3 method for class 'hngarch'
print(x, ...)
## S3 method for class 'hngarch'
summary(object, ...)
|
description |
a brief description of the porject of type character. |
innov |
[hngarchSim] - |
model |
a list of GARCH model parameters with the following entries:
|
n |
[hngarchSim] - |
n.start |
[hngarchSim] - |
object |
[summary] - |
rand.gen |
[hngarchSim] - |
start.innov |
[hngarchSim] - |
symmetric |
[hngarchFit] - |
title |
a character string which allows for a project title. |
trace |
[hngarchFit] - |
x |
[hngarchFit] - |
... |
additional arguments to be passed. |
Path Simulation:
The function hngarchSim simulates a Heston-Nandi Garch(1,1)
process with structure parameters specified through the list
model(lambda, omega, alpha, beta, gamma, rf).
Parameter Estimation:
The function hngarchFit estimates by the maximum log-likelihood
approach the parameters either for a symmetric or an asymmetric
Heston-Nandi Garch(1,1) model from the log returns x of a
financial time series. For optimization R's optim function is
used. Additional optimization parameters may be passed throught the
... argument.
Diagnostic Analysis:
The function summary.hngarch performs a diagnostic analysis
and recalculates conditional variances and innovations from the time
series.
Calculation of Moments:
The function hngarchStats calculates the first four true
moments of the unconditional log return distribution for a stationary
Heston-Nandi Garch(1,1) process with standard normally distributed
innovations. In addition the persistence and the expectation values
of sigma to the power 2, 4, 6, and 8 can be accessed.
hngarchSim
returns numeric vector with the simulated time
series points neglecting those from the first start.innov
innovations.
hngarchFit
returns list with two entries: The estimated model parmeters
model, where model is a list of the parameters
itself, and llh the value of the log likelihood.
hngarchStats
returns a list with the following components:
persistence, the value of the persistence,
meansigma2, meansigma4, meansigma6, meansigma8,
the expectation value of sigma to the power of 2, 4, 6, and 8,
mean, variance, skewness, kurtosis,
the mean, variance, skewness and kurtosis of the log returns.
summary.hngarch
returns list with the following elements: h,
a numeric vector with the conditional variances, z, a numeric
vector with the innovations.
Diethelm Wuertz for the Rmetrics R-port.
Heston S.L., Nandi S. (1997); A Closed-Form GARCH Option Pricing Model, Federal Reserve Bank of Atlanta.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## hngarchSim -
# Simulate a Heston Nandi Garch(1,1) Process:
# Symmetric Model - Parameters:
model = list(lambda = 4, omega = 8e-5, alpha = 6e-5,
beta = 0.7, gamma = 0, rf = 0)
ts = hngarchSim(model = model, n = 500, n.start = 100)
par(mfrow = c(2, 1), cex = 0.75)
ts.plot(ts, col = "steelblue", main = "HN Garch Symmetric Model")
grid()
## hngarchFit -
# HN-GARCH log likelihood Parameter Estimation:
# To speed up, we start with the simulated model ...
mle = hngarchFit(model = model, x = ts, symmetric = TRUE)
mle
## summary.hngarch -
# HN-GARCH Diagnostic Analysis:
par(mfrow = c(3, 1), cex = 0.75)
summary(mle)
## hngarchStats -
# HN-GARCH Moments:
hngarchStats(mle$model)
|
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics
Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Rmetrics Package fOptions
Pricing and Evaluating Basic Options
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Warning message:
In nlm(.llhHNGarch, par.start, trace = trace, symmetric = symmetric, :
NA/Inf replaced by maximum positive value
Title:
Heston-Nandi Garch Parameter Estimation
Call:
hngarchFit(x = ts, model = model, symmetric = TRUE)
Parameters:
lambda omega alpha beta gamma rf
4e+00 8e-05 6e-05 7e-01 0e+00 0e+00
Coefficients: lambda, omega, alpha, beta, gamma
lambda omega alpha beta gamma
3.308e+00 3.402e-05 7.460e-05 8.001e-01 0.000e+00
Log-Likelihood:
2436.63
Persistence and Variance:
0.800118
0.0005434072
Description:
Wed Jun 14 20:11:40 2017 by user: anon
Title:
Heston-Nandi Garch Parameter Estimation
Call:
hngarchFit(x = ts, model = model, symmetric = TRUE)
Parameters:
lambda omega alpha beta gamma rf
4e+00 8e-05 6e-05 7e-01 0e+00 0e+00
Coefficients: lambda, omega, alpha, beta, gamma
lambda omega alpha beta gamma
3.308e+00 3.402e-05 7.460e-05 8.001e-01 0.000e+00
Log-Likelihood:
2436.63
Persistence and Variance:
0.800118
0.0005434072
$mean
[1] 0.001797332
$variance
[1] 0.0005437456
$skewness
[1] 0.02422895
$kurtosis
[1] 3.315409
$persistence
[1] 0.800118
$leverage
[1] 0
$meansigma2
[1] 0.0005434072
$meansigma4
[1] 3.262268e-07
$meansigma6
[1] 2.177046e-10
$meansigma8
[1] 1.621986e-13
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.