Undefined function or variable 'mc'

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Undefined function or variable 'mc'

Postby yy1985 » Fri Feb 14, 2014 6:53 am

Dear Everyone:
When I run the [dsgevar_forward_calibrate_lambda.mod ] file in dynare again,
there is a trouble that I don't know how to solve it. it is coming up with the following
message:

??? Error using ==> eval
Undefined function or variable 'mc'.

Error in ==> read_variables at 72
dyn_tmp_01 = eval(var_names_01(dyn_i_01,:));

Error in ==> initialize_dataset at 32
rawdata = read_variables(datafile,varobs,[],xls.sheet,xls.range);

Error in ==> dynare_estimation_init at 347
dataset_=initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls);

Error in ==> dynare_estimation_1 at 59
[dataset_,xparam1,M_,options_,oo_,estim_params_,bayestopt_]=dynare_estimation_init(var_list_, dname, [], M_, options_, oo_, estim_params_, bayestopt_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> dsgevar_forward_calibrate_lambda at 259
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

I am very confused,so I really hope someone can help me to explain what’s gone
wrong?
Thanks
Yun

the dsgevar_forward_calibrate_lambda.mod file attachment as follows:
Attachments
dsgevar_forward_calibrate_lambda.mod
(3.04 KiB) Downloaded 99 times
yy1985
 
Posts: 27
Joined: Thu Feb 13, 2014 2:56 am

Re: Undefined function or variable 'mc'

Postby jpfeifer » Fri Feb 14, 2014 8:53 am

Could you please copy the mod-file to an completely empty folder and then try again.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Undefined function or variable 'mc'

Postby yy1985 » Fri Feb 14, 2014 9:09 am

Dear professor jpfeifer:
When I copy the mod-file to an completely empty folder and then try again,but the results as the same as before:

??? Error using ==> eval
Undefined function or variable 'mc'.

Error in ==> read_variables at 72
dyn_tmp_01 = eval(var_names_01(dyn_i_01,:));

Error in ==> initialize_dataset at 32
rawdata = read_variables(datafile,varobs,[],xls.sheet,xls.range);

Error in ==> dynare_estimation_init at 347
dataset_=initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls);

Error in ==> dynare_estimation_1 at 59
[dataset_,xparam1,M_,options_,oo_,estim_params_,bayestopt_]=dynare_estimation_init(var_list_, dname, [], M_, options_, oo_, estim_params_, bayestopt_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> dsgevar_forward_calibrate_lambda at 259
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

I want to know why?
Thanks
Yun
yy1985
 
Posts: 27
Joined: Thu Feb 13, 2014 2:56 am

Re: Undefined function or variable 'mc'

Postby jpfeifer » Fri Feb 14, 2014 9:17 am

Are you executing the mod-file in this folder? Does the folder after running the mod-file contain a datafile named datarabanal_hybrid.mat?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Undefined function or variable 'mc'

Postby yy1985 » Fri Feb 14, 2014 10:21 am

Dear professor jpfeifer:
Yes, after running the mod-file contain a datafile named datarabanal_hybrid.mat. I cann't understand why Undefined function or variable 'mc'?
in fact,datarabanal_hybrid.mat has contain variable 'mc'.
Thank you very much for you reply! I am very confused!
yun
yy1985
 
Posts: 27
Joined: Thu Feb 13, 2014 2:56 am

Re: Undefined function or variable 'mc'

Postby jpfeifer » Fri Feb 14, 2014 10:36 am

Please type
Code: Select all
which datarabanal_hybrid.m

in the Matlab command windows and post the answer here.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Undefined function or variable 'mc'

Postby yy1985 » Fri Feb 14, 2014 10:39 am

OK,the results is D:\DSGE\4.3.3\myyy\datarabanal_hybrid.m
yy1985
 
Posts: 27
Joined: Thu Feb 13, 2014 2:56 am

Re: Undefined function or variable 'mc'

Postby jpfeifer » Fri Feb 14, 2014 10:40 am

That is the source of your problems. Delete that file.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Undefined function or variable 'mc'

Postby jpfeifer » Fri Feb 14, 2014 10:41 am

And while you are at it, also delete the Matlab path to that directory.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Undefined function or variable 'mc'

Postby yy1985 » Fri Feb 14, 2014 10:55 am

Dear professor jpfeifer:
You are very enthusiastic, thank you very much! Under the guidance of your wise, this problem solved!Thank you very much !
yun
yy1985
 
Posts: 27
Joined: Thu Feb 13, 2014 2:56 am

Re: Undefined function or variable 'mc'

Postby Oriana » Mon Mar 09, 2015 6:57 pm

Hi,
I am trying to convert a estimated US model ( please see nonlinearomega.mod file ) into a multi-country model ( with three countries, please see nonlinearomegamulti.mod file ).
The estimated US model already runs. Nevertheless, I got the following errors with the multi-country version:

Error using eval
Undefined function or variable 'c3sigma'.

Error in nonlinearomega_steadystate (line 44)
eval(['M_.params(icount) = ',M_.param_names(icount,:),';'])

Error in evaluate_steady_state_file (line 49)
[ys,check] = h_steadystate(ys_init, exo_ss);

Error in evaluate_steady_state (line 58)
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, ...

Error in steady_ (line 54)
[steady_state,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in steady (line 81)
[steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in nonlinearomega (line 3094)
steady;

Error in dynare (line 180)
evalin('base',fname) ;

It seems weird as 'c3sigma' is already defined. I would really appreciate if someone could help on this matter.
Attachments
nonlinearomega.mod
(60.99 KiB) Downloaded 40 times
nonlinearomegamulti.mod
(86.33 KiB) Downloaded 48 times
Oriana
 
Posts: 67
Joined: Fri Jul 18, 2014 2:49 pm

Re: Undefined function or variable 'mc'

Postby Oriana » Tue Mar 10, 2015 11:00 am

Hi,
I am trying to convert a estimated US model ( please see nonlinearomega-2.zip file ) into a multi-country model ( with three countries, please see nonlinearomega-multi copy.zip file ).
The estimated US model already runs. Nevertheless, I got the following errors with the multi-country version:

Error using eval
Undefined function or variable 'c3sigma'.

Error in nonlinearomega_steadystate (line 44)
eval(['M_.params(icount) = ',M_.param_names(icount,:),';'])

Error in evaluate_steady_state_file (line 49)
[ys,check] = h_steadystate(ys_init, exo_ss);

Error in evaluate_steady_state (line 58)
[ys,params,info] = evaluate_steady_state_file(ys_init,exo_ss,M, ...

Error in steady_ (line 54)
[steady_state,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in steady (line 81)
[steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in nonlinearomega (line 3094)
steady;

Error in dynare (line 180)
evalin('base',fname) ;

It seems weird as 'c3sigma' is already defined. I would really appreciate if someone could help on this matter.
Attachments
nonlinearomega-2.zip
(601.77 KiB) Downloaded 46 times
nonlinearomega-multi copy.zip
(807.41 KiB) Downloaded 50 times
Oriana
 
Posts: 67
Joined: Fri Jul 18, 2014 2:49 pm

Re: Undefined function or variable 'mc'

Postby jpfeifer » Tue Mar 10, 2015 11:11 am

This sounds like a mistake in your steady state file. But you did not post it
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Undefined function or variable 'mc'

Postby Oriana » Tue Mar 10, 2015 1:04 pm

The steady state file of the multi-country model is very similar to the estimated US model. In the former file I only added the steady state variables of the third country.

If possible, please, see the nonlinearomega_steadystate.m file in the folders attached below.
Attachments
nonlinearomega-2.zip
(601.77 KiB) Downloaded 53 times
nonlinearomega-multi copy.zip
(807.41 KiB) Downloaded 49 times
Oriana
 
Posts: 67
Joined: Fri Jul 18, 2014 2:49 pm

Re: Undefined function or variable 'mc'

Postby jpfeifer » Tue Mar 10, 2015 1:24 pm

Your steady state file does not correctly read in the parameters of the model. You should be using the header/footer of the NK_baseline_steady_state.m file in the Dynare examples folder.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Next

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 10 guests