help with the error

Hi can some one please help me correct this error:
Code:
clc;
clear;
model = garch('Constant',0.1,'GARCH',0.4,'ARCH',0.5);
rng('default')
[Vn,Yn] = simulate(model,100,'numPaths',5);
Error:
Undefined function 'garch' for input arguments of type 'char'.
Error in simm (line 4)
model = garch('Constant',0.1,'GARCH',0.4,'ARCH',0.5);

댓글 수: 2

the cyclist
the cyclist 2013년 7월 3일
What do get if you type
which garch
?
dav
dav 2013년 7월 3일
'garch' not found.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shashank Prasanna
Shashank Prasanna 2013년 7월 3일
편집: Shashank Prasanna 2013년 7월 3일

0 개 추천

You either:
1) Don't have the Econometrics Toolbox installed. Check the output of VER:
>> ver
2) Are using a version of MATLAB older than MATLAB r2012a
Here are the release notes:

댓글 수: 4

dav
dav 2013년 7월 3일
편집: dav 2013년 7월 3일
this is what I get: and i dont have have the Econometrics Toolbox . how can i install it please?
>> ver
-------------------------------------------------------------------------------------------------------
MATLAB Version: 7.14.0.739 (R2012a)
MATLAB License Number: •••••
Operating System: Microsoft Windows 7 Version 6.1 (Build 7600)
Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------------------------
Shashank Prasanna
Shashank Prasanna 2013년 7월 3일
Dav, you don't have the Econometrics Toolbox installed with your MATLAB.
Which means you won't be able to use the garch functions.
You can either obtain the econometrics toolbox and install it or look for alternatives in the File Exchange:
dav
dav 2013년 7월 3일
편집: dav 2013년 7월 3일
Thanks.I needed it to generate an ARCH data set. I was using the following code but for some reason it doesn't give me the correct parameter estimates when I checked for them
Code:
T = 300;
a0 = 0.1; a1 = 0.4;
ra = zeros(T+2000,1);
seed=123;
rng(seed);
%ra = randn(T+2000,1);
ra = trnd(5,T+2000,1);
epsi=zeros(T+2000,1);
simsig=zeros(T+2000,1);
unvar = a0/(1-a1);
for i = 1:T+2000
if (i==1)
simsig(i) = unvar;
s=(simsig(i))^0.5;
epsi(i) = ra(i) * s;
else
simsig(i) = a0+ a1*(epsi(i-1))^2;
s=(simsig(i))^0.5;
epsi(i) = ra(i)* s;
end
end
Is there a way to estimate the parameters of this dataset?
Thanks
Shashank Prasanna
Shashank Prasanna 2013년 7월 3일
Please post a new question since this isn't related to the original question. This way you will have more eyes looking at it.
You can estimate your parameters by calling the arima estimate function part of the econometrics toolbox. If you don't have it you can try using some functions written by other in the file exchange the link to which I shared in the previous post.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Conditional Variance Models에 대해 자세히 알아보기

질문:

dav
2013년 7월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by