about mex documents and dynare_simul_

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.

about mex documents and dynare_simul_

Postby kingtobe » Tue Aug 30, 2016 12:09 pm

In the directory C:\dynare\4.4.3\mex\matlab, there are many mex files. what are they?

Here is a line of codes, and I do not know whether it relates to mex file dynare_simul_. What does dynare_simul_.mexw64 mean ? Can somebody tell me ? Thank you!

[err, y_] = dynare_simul_(3,M_.nstatic,M_.npred,M_.nboth,M_.nfwrd,exo_nbr, ...
y_(dr.order_var,1),ex_',M_.Sigma_e,options_.DynareRandomStreams.seed,dr.ys(dr.order_var),dr.g_0, ...
dr.g_1,dr.g_2,dr.g_3);
kingtobe
 
Posts: 2
Joined: Tue Aug 30, 2016 12:01 pm

Re: about mex documents and dynare_simul_

Postby jpfeifer » Tue Aug 30, 2016 2:31 pm

mex-files are precompiled files that Matlab (a non-compiled language) can use to speed up computationally intensive tasks. If you want to learn more about those, see http://de.mathworks.com/help/matlab/matlab_external/introducing-mex-files.html
------------
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: about mex documents and dynare_simul_

Postby rhein » Wed Aug 31, 2016 12:22 am

On the same topic, I am experiencing errors regarding the dynare_simul.m after running model via dynare++

Code: Select all
t=840;
nsimul=100;
shocks = zeros (2,t)./0;
sim_results=zeros(20,t,nsimul);
for i=1:nsimul
    sim_results(:,:,i)=dynare_simul('model.mat', shocks);
end

Invalid MEX-file 'E:\dynare\4.4.3\mex\matlab\win64-7.3-7.4\dynare_simul_.mexw64': The specified procedure
could not be found.


Just to clarify, I did add path with the routines via:
Code: Select all
addpath(genpath('E:\dynare\4.4.3\dynare++'))
addpath(genpath('E:\dynare\4.4.3\matlab'))


Do you maybe know what the reason might be?
Thanks in advance!
rhein
 
Posts: 8
Joined: Thu Aug 25, 2016 6:35 pm

Re: about mex documents and dynare_simul_

Postby jpfeifer » Wed Aug 31, 2016 6:07 am

You are missing
Code: Select all
addpath('E:\dynare\4.4.3\mex\your system path belongs 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: about mex documents and dynare_simul_

Postby rhein » Wed Aug 31, 2016 3:21 pm

Thank you very much for your comment. However I am still obtaining the same error, even though I did add the mex folder and subfolders to the matlab paths.
Do you maybe know what may be causing a problem?

My conjecture is that there might be an issue with discrepancies between the versions of compiler used to generate mex files and the one I have installed on my lapot (I have SDK 7.1 (C) ).Do you maybe know which version was used to create the dynare .mex files?

Second question: I am also using the dynare at the university PC lab, which does not have any mex compiler installed. Do you know if there is any way to avoid calling .mex files with dynare_simul() function?
rhein
 
Posts: 8
Joined: Thu Aug 25, 2016 6:35 pm

Re: about mex documents and dynare_simul_

Postby jpfeifer » Wed Aug 31, 2016 4:30 pm

As long as the mex-files match your Windows system, you should be fine. You don't need a compiler on Windows.
However, I just recognized that it is a bad idea to use
Code: Select all
addpath(genpath('E:\dynare\4.4.3\mex'))

because this will add a path to all mex-files, i.e. for Octave and all Windows and Matlab versions. Thereby, you will have no control over which one is actually on top of the path. Please identify your system (32 bit vs, 64 bit) and your Matlab version (ver command in Matlab) and set a path to only the subfolder corresponding to your system.
------------
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: about mex documents and dynare_simul_

Postby rhein » Wed Aug 31, 2016 5:00 pm

I did what you suggested and now it works !
Thank you very much for your help.
rhein
 
Posts: 8
Joined: Thu Aug 25, 2016 6:35 pm

Re: about mex documents and dynare_simul_

Postby kingtobe » Thu Sep 01, 2016 9:41 am

Thank you for your reply.

jpfeifer wrote:mex-files are precompiled files that Matlab (a non-compiled language) can use to speed up computationally intensive tasks. If you want to learn more about those, see http://de.mathworks.com/help/matlab/matlab_external/introducing-mex-files.html
kingtobe
 
Posts: 2
Joined: Tue Aug 30, 2016 12:01 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 10 guests