finding MLE by OLS initial parameters for CIR MODEL (kladivko contribution)

Hi,
I run the kladivko contribution for CIR model MLE of parameters
I run
Results = CIRestimation(g)
where "g" is a 16419x1 double case. The result is
??? Warning: Struct field assignment overwrites a value with class "double".
See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details.
> In CIRestimation at 34
initial alpha = +0.012735
initial mu = +0.233222
initial sigma = +0.120850
??? Undefined function or method 'mtimes' for input arguments of type 'struct'.
Error in ==> CIRobjective1 at 27
u = c*exp(-alpha*TimeStep)*DataL;
Error in ==> CIRestimation>@(Params)CIRobjective1(Params,Model) at 47
[Params, Fval, Exitflag] = fminsearch(@(Params)CIRobjective1(Params, Model), InitialParams, options);
Error in ==> fminsearch at 205
fv(:,1) = funfcn(x,varargin{:});
Error in ==> CIRestimation at 47
[Params, Fval, Exitflag] = fminsearch(@(Params)CIRobjective1(Params, Model), InitialParams, options);
Could you please help me why I get these errors?
I have attached the .m files.
Thank you, Masoud

3 Comments

how do you get the original data Pribor3M?
Pribor3M data set is actually the time-series of your gathered and measured data regarding the limits and conditions.
I did not run actually the very Pribor3M data set noted in the paper. You can modify your own type of data set with observing the peculiarities of data set in your type of research area.
But, if you need Pribor3M.MAT file for MATLAB just go to this link:
Good Luck.
By the way, take a look at this webpage too:
I think it would be helpful.

Sign in to comment.

Answers (2)

You SHOULD enter the data in "structure" format, For example(Model=struct('Data',zeros(165,1),'TimeStep',1/12,'Disp','n','Method','besseli','MatlabDisp','off'). "Data" should be in colum from newest to oldest data. Therefore you can run the model and that is.

1 Comment

Thank you very much. I have solved the issue.
I am grateful for your enormous help.

Sign in to comment.

I'm sorry, may I ask a question? Right now I'm working on univariate AR(1) model based on CIR to forecast yield curve in the future. But I guess I need CIR parameters for EACH day. So I'm trying to get cross-sectional estimate of CIR parameters. Can I use Kladivko's source code in "maximum likelihood estimation: matlab implementation" to get these parameters?
Thankyou so much for your help.

Categories

Find more on Financial Toolbox in Help Center and File Exchange

Tags

Asked:

on 26 Sep 2013

Answered:

on 9 Apr 2014

Community Treasure Hunt

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

Start Hunting!