Do my Toolboxes work?

1 次查看(过去 30 天)
Karl-Martin
Karl-Martin 2014-12-9
回答: Guillaume 2014-12-9
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 个评论
Karl-Martin
Karl-Martin 2014-12-9
编辑:Karl-Martin 2014-12-9
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 2014-12-9
编辑:Adam 2014-12-9
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...

请先登录,再进行评论。

采纳的回答

Guillaume
Guillaume 2014-12-9
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.

更多回答(1 个)

Adam
Adam 2014-12-9
编辑:Adam 2014-12-9
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.

类别

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