필터 지우기
필터 지우기

Estimating GARCH parameters using fmincon

조회 수: 1 (최근 30일)
Jen
Jen 2011년 8월 26일
Hi,
I am using the following code to estimate the garch parameters. However I get the following message:
fmincon stopped because it exceeded the function evaluation limit, options.MaxFunEvals = 300 (the default value).
I have increased the value, but am getting the same message?!?!
-------------------------------------------------------------------
par0 = [0.00001,0.09,0.89];
A = [0,1,1];
b = 1;
[par,fval] = fmincon(@GarchParameters,par0,A,b,[],[],[0,0,0],[]);
--------------------------------------------------------------
function LLF = GarchParameters(par)
data = xlsread('FTSEPrices.xlsx');
Prices = data;
T = length(Prices);
LogReturns = zeros(T-1,1);
for i = 1:T-1
LogReturns(i) = log(Prices(i+1)/Prices(i));
end
AverLogReturns = mean(LogReturns);
ErrorTermSquared = (LogReturns - AverLogReturns).^2;
AverageErrorTermSquared = mean(ErrorTermSquared);
ConditionalVariance = zeros(T,1);
ConditionalVariance(1) = par(1)+par(2)*AverageErrorTermSquared + par(3)
*AverageErrorTermSquared;
for i = 2:T
ConditionalVariance(i) = par(1) + par(2)*ErrorTermSquared(i-1) + par(3)
*ConditionalVariance(i-1);
end
ConditionalVariance = ConditionalVariance(2:end);
LLF = 0.5*sum(log(ConditionalVariance))+0.5*(sum(ErrorTermSquared.
/ConditionalVariance));
--------------------------------------------------------------------
Please help
Thanks Jen

답변 (0개)

카테고리

Help CenterFile Exchange에서 Conditional Variance Models에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by