Do my Toolboxes work?

4 views (last 30 days)
Karl-Martin
Karl-Martin on 9 Dec 2014
Answered: Guillaume on 9 Dec 2014
Hi,
I want to fit a Conditional Variance Model, given some specified data, using:
model = arima('ARLags',1,'Variance',garch(1,1))
fit = estimate(model,data);
Unfortunately, I get an error:
??? Undefined function or method 'garch'
for input arguments of type 'double'.
But the function 'garch' is part of the Econometrics Toolbox. When I ask for
>> ver
I get:
-------------------------------------------------------------------------------------
MATLAB Version 7.10.0.499 (R2010a)
MATLAB License Number: STUDENT
Operating System: Microsoft Windows 7 Version 6.2 (Build 9200)
Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
-------------------------------------------------------------------------------------
MATLAB Version 7.10 (R2010a)
Simulink Version 7.5 (R2010a)
Control System Toolbox Version 8.5 (R2010a)
Econometrics Toolbox Version 1.3 (R2010a)
Financial Toolbox Version 3.7.1 (R2010a)
Image Processing Toolbox Version 7.0 (R2010a)
Optimization Toolbox Version 5.0 (R2010a)
Signal Processing Blockset Version 7.0 (R2010a)
Signal Processing Toolbox Version 6.13 (R2010a)
Statistics Toolbox Version 7.3 (R2010a)
Symbolic Math Toolbox Version 5.4 (R2010a)
So obviously all Toolboxes are installed. The Econometrics Toolbox is quite large with lots of .m files in different folders and subfolders, all within the Matlab installation folder.
But my working folder is different! Do I have to work within the Toolbox folder to have access to all the .m files? Or do I have to copy the .m files I need from the Toolbox into my working folder?
Thanks in advance!
Karl
  3 Comments
Karl-Martin
Karl-Martin on 9 Dec 2014
Edited: Karl-Martin on 9 Dec 2014
When I type:
>> which garch
I get:
'garch' not found.
The Toolboxes are located in the Matlab installation folder, I did not moved them. You´re right, garch is not a function, it is a class used to specify a model as an input argument. I am sure the syntax is valid, it is taken from:
Adam
Adam on 9 Dec 2014
Edited: Adam on 9 Dec 2014
Yes, the syntax looks fine, but you seem to have lost that toolbox from your path, as indicated by the which function result.
Although, that is an R2014a help link...

Sign in to comment.

Accepted Answer

Guillaume
Guillaume on 9 Dec 2014
There are various garch* functions in the Econ toolbox of 2010a, but no garch itself, according to the documentation.
You probably could have checked that yourself by typing
docsearch garch
at the comment prompt of your matlab 2010a, or just navigating to the help page of the toolbox.

More Answers (1)

Adam
Adam on 9 Dec 2014
Edited: Adam on 9 Dec 2014
First you need to check if this class exists in your version. I suspect it does not since R2010a is quite old and class-based implementations of Matlab builtin functionality have been quite recently expanding.
If it is in the R2010a version then do the following, but I suspect it is not as it is highly unlikely you have lost the toolbox from your path.
Locate the toolbox root folder and add this to your path, either using the addpath function or simpler by finding clicking on "Add Path" in the main Matlab UI and click 'Save' to ensure it stays there beyond the current session.
I'm not entirely sure where "Add Path" is located in R2010a, but it should be somewhere visible.

Tags

Community Treasure Hunt

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

Start Hunting!