? Error using ==> mtimes


I have a model which can be solved using the stoch_simul command.
But when I try to estimate it there seem to be problems related to matrix dimension and I get the following error message.

??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> metropolis_hastings_initialization at 94
candidate = rand_multivariate_normal( transpose(xparam1), d * options_.mh_init_scale, npar);

Error in ==> random_walk_metropolis_hastings at 58
ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns, NewFile, MAX_nruns, d ] = …

Error in ==> dynare_estimation_1 at 1106

Error in ==> dynare_estimation at 62

Error in ==> korea at 273

And before this, I received such message

MH: Multiple chains mode.
MH: Searching for initial values…
MH: I couldn’t get a valid initial value in 100 trials.
MH: You should Reduce mh_init_scale…
MH: Parameter mh_init_scale is equal to 0.400000.
MH: Enter a new value…

What’s the problem?
I attached the mod file and data.
korea.mod (2.68 KB)
data_kr.xls (19.5 KB)

Hi, I would say there are several problems. First, you should use the calibrated parameters as starting values for the estimation. This should look like:

estimated_params; h, 0.92, , ,beta_pdf, 0.7, 0.2; sigma, 0.39, , ,normal_pdf, 1.0, 0.25; phi,1.82, , ,gamma_pdf, 1.0, 0.3; eta,0.85, , ,gamma_pdf, 1.0, 0.3;
The first number is the starting value, the two empty fields denote the lower and upper bounds of the prior, which are automatically set by Dynare to fit the prior mean and variance.

Second, I am not sure your data fits your model. The data y seems to have a clear trend in the xls-file, while it has to be stationary for the model. Look into the numerous posts on how to specify the observation equations.

Lastly, estimating 20 parameters on 16 data points seems a bit optimistic.

Thank you for your reply.
I revised the problem about parameter’s estimated value.

But, I still have a question about that.
Among parameters, I want to fix the values of alph and beta at 0.4 and 0.99 respectively.
In this case, how I write the .mod file?

When I tried as attached file, the warning is approached as below.

Warning: Some of the parameters have no value (beta, alpha, h, sigma, phi, eta, thetah, thetaf, rhoa, phi1, phi2, rhor, lam1, rhorstar, lambdah, lambdaf) when using steady. If these parameters are not initialized in a steadystate file, Dynare may not be able to solve the model…

In test_for_deep_parameters_calibration at 46
In steady at 33
In kr at 163
In dynare at 132
STEADY: numerical initial values incompatible with the following equations
1 2 3 5 6 8 9 10 11 12 13

??? Error using ==> dynare_solve
exiting …

Error in ==> steady_ at 120
[oo_.steady_state,check] = dynare_solve([M_.fname ‘_static’],…

Error in ==> steady at 54

Error in ==> kr at 163

Error in ==> dynare at 132
evalin(‘base’,fname) ;

Are they given at ‘estimated_params’ space or beneath a name of ‘parameters’?

What can I do to solve these problems?
Please help me!!
kr.mod (2.39 KB)

The parameters you do not want to estimate are set in the parameters-block before the model-block. By omitting them from the estimated_params-block they are kept fixed at this inital value during estimation.

When I revised above reply, you posted the new reply.
Please review my question and mod file.

When I omitted parameters which don’t want to estimate, the same warning is appeared as above.
I don’t know how I fix the mod file. :cry:

Even when estimating some parameters later, all parameters always have to be initiated in the parameters-block.


I am trying to estimate the model coded in the nonlinearomega.mod file ( please, see the attachments below ).
Nevertheless, I got the following errors :

Warning: Range cannot be used in ‘basic’ mode. The entire sheet will be loaded.

In xlsread at 199
In load_xls_file_data at 67
In read_variables at 92
In initialize_dataset at 32
In dynare_estimation_init at 479
In dynare_estimation_1 at 81
In dynare_estimation at 89
In nonlinearomega at 2107
In dynare at 180
Loading 160 observations from data.xls

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: You should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

Error using *
Inner matrix dimensions must agree.

Error in dsge_likelihood (line 374)
Pstar =

Error in initial_estimation_checks (line 47)
[fval,junk1,junk2,a,b,c,d] =

Error in dynare_estimation_1 (line 179)
oo_ =

Error in dynare_estimation (line 89)

Error in nonlinearomega (line 2107)

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

After some modifications on my previous version I have no idea what I can do more to fix the problem.
I shall be deeply grateful if someone can give me some feedback on this matter.
nonlinearomega.zip (479 KB)

Before starting estimation, make sure your model runs with stoch_simul. There are still mistakes in your model.
You have the equation

log(log_oil_price) - log(log_oil_price(-1)) = log( c1rpopd / c1rpopd(-1) * ( 1 - ( c1rpopd(-1) * c1oy(-1) / c1y(-1)) + ( c1rpopd(-1) * c1yo(-1) / c1y(-1)) ) / (1 - ( c1rpopd * c1oy / c1y) + ( c1rpopd * c1yo / c1y)) *
but log_oil_price is 0 so you are taking the log of 0.

Thank you for your precious help!

After some modifications to the previous version I got the following diagnostic

model_diagnostic: the Jacobian of the static model is singular
there is 2 colinear relationships between the variables and the equations
Relation 1
Colinear variables:
Relation 2
Colinear variables:
Relation 1
Colinear equations
224 227

Relation 2
Colinear equations

The presence of a singularity problem typically indicates that there is one
redundant equation entered in the model block, while another non-redundant equation
is missing. The problem often derives from Walras Law.

Singularity is possibly due an intended unit root on the equation 227

c1gdp = c1gdp(-1) * (c1y - c1rpopd(-1) * c1oy + c1rpopd(-1) * c1yo) / (c1y(-1) - c1rpopd(-1) * c1oy(-1) + c1rpopd(-1) * c1yo(-1));

Am I right ?
If so, please, what is supposed to do next?
nonlinearomega.zip (492 KB)

Please, I would really appreciate some help on this matter!!

Your model is big and complex, so I won’t be of much help. A unit root will give rise to collinearity. If the unit root is intended, you can ignore the message. If it is not intended, you need to find the mistake that gives rise to it.