Directory of Open Source for Quantitative Finance and Trading
Username: Password: Not registered?
 
Quick Search:    (AJAX based: No need to press button)

Main : C++ : 


Category: C++ View Full Details
Download Now!Garch Fitting by Maximum Likelihood Estimation (MLE)
Submitter: vanna Date: 2010/11/28
Description:
This program uses maximum likelihood estimation for calibration of GARCH(1,1) Heston Nandi process as described in paper A Closed-Form GARCH Option Valuation Model

Inputs considered are :
1. Risk free rate
2. File containing array of asset prices eg.,
stockprices.txt


Following is an example scenario for testing:

1.Execute octave script nandigen.m

2.stock prices are generated in C:\ Program Files\ GNU Octave 2.1.73\ octave_files\ stockprices.txt

3.Compile and run the Garch fitting program. (refer FAQ HOW TO USE GSL in Dev C++ for details)



Following is example of input parameters in genrating file:

%------ Enter parameters --------------
lambda = 4;
omega = 8e-7; %constant intercept of model
alpha = 6e-7; %alpha of model - should control kurtosis
beta = 0.8;
gamma = 80; %gamma of model - should control skewness
r = 0.0; %continuosuly compounded rate
nstart=1; %no. of points after which the series is noted
nend=10000; %no. of observations
S0 = 100; %initial spot price
%--------------------------------------



Following is output values after running grachfit program:

lambda=7.61782 omega=6.91513e-007 alpha=5.82825e-007 beta=0.822984 gamma=85.0409
testval=0.827199
tmpsum=35799.2
converged to minimum after 300 iteration(s) at



Edit : Here is a link to the same program if you would like to use GSL in Visual C++ 2010:
http://www.quantcode.com/modules/docmanager/view_file.php?curent_file=361&curent_dir=19

Got a question or problem with this link? Just enter your message and click on submit. No registration is required.

Note: A copy of this message will also be emailed to the submitter of this link
Downloaded 3059 times  3059  File Size 0 bytes  Supported Platforms C++/ GSL/ DevC++/ Windows  Home Page http://www.quantcode.com/
Rating: 0.00 (0 votes)
Rate this File | Modify | Delete | Report Broken File | Tell a Friend | Comments (9)

Poster Thread
michelle
Posted: 2010/2/1 20:07  Updated: 2010/2/1 20:07
Just popping in
Joined: 2010/2/1
From:
Posts: 1
 Re: Garch Fitting by Maximum Likelihood Estimation (MLE)
Hi~Thank you for posting such useful thing!However, when I use the data from A cloesd-form GARCH option valuation model, I cannot get the similar estimates when using MLE method. What's the problem when I using your code? Thank you!

Poster Thread
vanna
Posted: 2010/11/28 13:50  Updated: 2010/11/28 13:51
Just can't stay away
Joined: 2007/3/21
From:
Posts: 104
 Re: Garch Fitting by Maximum Likelihood Estimation (MLE)
Hi Michelle,
Thanks for using QuantCode! I also have a problem that lambda is not matching and is coming ~7 instead of ~4 which was used for simulation. I think it is because of behavior impact on the output of the likelihood function when lambda parameter is getting changed. If the sensitivity on function output is less, minimizer will converge earlier. It guess it could be overcome by trial and error of using different minimizer configuration, start values, etc.

Poster Thread
Anonymous
Posted: 2011/7/5 20:21  Updated: 2011/7/6 13:00
 Garch Fitting by Maximum Likelihood Estimation (MLE)
Hi,
Thank you for such great code. Would you happen to have this code in MATLAB?

Poster Thread
Anonymous
Posted: 2012/7/19 14:15  Updated: 2012/7/20 13:11
 Garch Fitting by Maximum Likelihood Estimation (MLE)
Does anybody have code for this in Matlab?

Discuss this file. Just enter your message and click on submit. No registration is required.
Similar Links:
maximum likelihood estimation (Forum)
Maximum Likelihood estimation using Kalman filter (Software)
Maximum Likelihood estimation with Kalman Filter (Software)
Tutorial on Maximum Likelihood estimation (Software)
Maximum likelihood estimation of stochastic volatility models (Paper)

Subscribe to RSS or daily email updates of latest quantitative finance code listings
Email address :
Copyright © 2011 QuantCode Inc. All rights reserved.