{"action":"created","issue":{"url":"https://api.github.com/repos/DynareTeam/dynare/issues/828","labels_url":"https://api.github.com/repos/DynareTeam/dynare/issues/828/labels{/name}","comments_url":"https://api.github.com/repos/DynareTeam/dynare/issues/828/comments","events_url":"https://api.github.com/repos/DynareTeam/dynare/issues/828/events","html_url":"https://github.com/DynareTeam/dynare/issues/828","id":52151724,"number":828,"title":"Investigate why mod-file using k_order_pert crashes Matlab","user":{"login":"JohannesPfeifer","id":3679304,"avatar_url":"https://avatars.githubusercontent.com/u/3679304?v=3","gravatar_id":"","url":"https://api.github.com/users/JohannesPfeifer","html_url":"https://github.com/JohannesPfeifer","followers_url":"https://api.github.com/users/JohannesPfeifer/followers","following_url":"https://api.github.com/users/JohannesPfeifer/following{/other_user}","gists_url":"https://api.github.com/users/JohannesPfeifer/gists{/gist_id}","starred_url":"https://api.github.com/users/JohannesPfeifer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohannesPfeifer/subscriptions","organizations_url":"https://api.github.com/users/JohannesPfeifer/orgs","repos_url":"https://api.github.com/users/JohannesPfeifer/repos","events_url":"https://api.github.com/users/JohannesPfeifer/events{/privacy}","received_events_url":"https://api.github.com/users/JohannesPfeifer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DynareTeam/dynare/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"houtanb","id":584723,"avatar_url":"https://avatars.githubusercontent.com/u/584723?v=3","gravatar_id":"","url":"https://api.github.com/users/houtanb","html_url":"https://github.com/houtanb","followers_url":"https://api.github.com/users/houtanb/followers","following_url":"https://api.github.com/users/houtanb/following{/other_user}","gists_url":"https://api.github.com/users/houtanb/gists{/gist_id}","starred_url":"https://api.github.com/users/houtanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houtanb/subscriptions","organizations_url":"https://api.github.com/users/houtanb/orgs","repos_url":"https://api.github.com/users/houtanb/repos","events_url":"https://api.github.com/users/houtanb/events{/privacy}","received_events_url":"https://api.github.com/users/houtanb/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/DynareTeam/dynare/milestones/6","html_url":"https://github.com/DynareTeam/dynare/milestones/4.5","labels_url":"https://api.github.com/repos/DynareTeam/dynare/milestones/6/labels","id":344014,"number":6,"title":"4.5","description":"","creator":{"login":"sebastien-villemot","id":586809,"avatar_url":"https://avatars.githubusercontent.com/u/586809?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastien-villemot","html_url":"https://github.com/sebastien-villemot","followers_url":"https://api.github.com/users/sebastien-villemot/followers","following_url":"https://api.github.com/users/sebastien-villemot/following{/other_user}","gists_url":"https://api.github.com/users/sebastien-villemot/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastien-villemot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastien-villemot/subscriptions","organizations_url":"https://api.github.com/users/sebastien-villemot/orgs","repos_url":"https://api.github.com/users/sebastien-villemot/repos","events_url":"https://api.github.com/users/sebastien-villemot/events{/privacy}","received_events_url":"https://api.github.com/users/sebastien-villemot/received_events","type":"User","site_admin":false},"open_issues":79,"closed_issues":64,"state":"open","created_at":"2013-05-29T10:19:26Z","updated_at":"2015-03-16T16:08:24Z","due_on":"2015-06-29T22:00:00Z","closed_at":null},"comments":11,"created_at":"2014-12-16T18:51:26Z","updated_at":"2015-03-18T16:01:21Z","closed_at":null,"body":"The following mod-file crashes Matlab on different Windows and Dynare versions (http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6306):\r\n```\r\n\r\n%------------------------------------------------------------------------------------------%\r\n%                                 VARIABLES ENDO                                           % \r\n%------------------------------------------------------------------------------------------%\r\n\r\n\r\nvar y c i L k khat u betateta q teta w Rk Qtilde Omega pi pireset X1 X2 mc v  r rr Spr A ;\r\n\r\n%------------------------------------------------------------------------------------------%\r\n%                                 VARIABLES EXO                                            % \r\n%------------------------------------------------------------------------------------------%\r\n\r\nvarexo \r\neteta        % disaster probability shock \r\ner           % monetary policy shock\r\n;\r\n\r\n%------------------------------------------------------------------------------------------%\r\n%                                 PARAMETERS                                               % \r\n%------------------------------------------------------------------------------------------%\r\nparameters muz, beta0, delta0, zeta, upsilon, sigxi, muxi, gamma, psi, psitilde, chi, alpha, varpi, tau,\r\nrhor, rhoteta, phipi, phiy, sigr, sigteta, sigz, eta, yss, rss, iss, kss, piss, tetass, uss,  betatetass, bk; \r\n\r\nmuz = 0.005;                   \r\ndelta0 = 0.02;                 \r\nzeta = 0.8;                  \r\nupsilon = 6;                   \r\nsigxi = 0.092;                 \r\nmuxi = -0.007;                 \r\ngamma = 3.8;                   \r\nalpha = 0.33;                  \r\ntau = 1.7;           \t\t\t\r\nrhor =0.85;                   \r\nrhoteta =0.85;                  \r\nphipi = 1.5;                  \r\nphiy = 0.5;                   \r\nsigr = 0.01;                      \r\nsigteta = 0.01;                    \r\nsigz = 0;                      \r\npsitilde = 0.5;                  \r\nbk = 0.43;  \r\npiss = 1.005;                   \r\ntetass = 0.0072;                \r\nuss = 1;                        \r\nqss = 1;                        \r\nvarpi = 2.33;                    \r\npsi=1-((1-psitilde)/(1+varpi));\r\nchi = 1- (1-gamma)/(1-psi);\r\nbeta0 = 0.999;\r\nbetatetass = beta0 * ((1 - tetass + tetass * exp((1-gamma)*log(1-bk)))^(1/(1-chi)));                   \r\n%------------------------------------------------------------------------------------------%\r\n%                                 STEADY STATE PARAMETERS                                  % \r\n%------------------------------------------------------------------------------------------%\r\n\r\nQtildess=betatetass*exp((1-psi)*muz);\r\nrss=exp(muz)*(piss)/Qtildess;\r\neta=(exp(muz)/(Qtildess*(1-tetass*bk))-1)*1/delta0 +1;\r\nrkss=delta0*eta;\r\npiresetss=(((piss)^(1-upsilon)-zeta)/(1-zeta))^(1/(1-upsilon));\r\nAss=exp(-muz)*(1 - tetass + tetass/(1-bk));\r\nmcss=((upsilon-1)/upsilon)*(1/(piss))*((1-(zeta*Ass*Qtildess*(piss)^upsilon))/(1-(zeta*Ass*Qtildess*(piss)^(upsilon-1))))*(piresetss);\r\nklss=(mcss*alpha/rkss)^(1/(1-alpha));\r\nwss=mcss*(1-alpha)*(klss)^alpha;\r\nomegass=((1-zeta)*(piresetss)^(-upsilon)*(piss)^upsilon)/(1-zeta*(piss)^upsilon);\r\nclss=(1/omegass)*(klss)^alpha - klss*(exp(muz)/(1-tetass*bk)-1+delta0);\r\nlss=1/(1+(varpi/wss)*clss);\r\nkss=klss*lss;\r\nkhatss=kss;\r\ncss=clss*lss;\r\nylss=clss+klss*(exp(muz)/(1-tetass*bk)-1+delta0);\r\nyss=ylss*lss;\r\niss=yss-css;\r\nX1ss=yss*mcss/(1-zeta*Ass*Qtildess*(piss)^upsilon);\r\nX2ss=yss/(1-zeta*Ass*Qtildess*(piss)^(upsilon-1));\r\nvss=(css*(1-lss)^varpi)^(1-psi) /(1-betatetass*exp(muz*(1-psi)));\r\nrrss = rss/piss;\r\nsprss = rkss/rrss;\r\n\r\n%------------------------------------------------------------------------------------------%\r\n%                                 MODEL                                                    % \r\n%------------------------------------------------------------------------------------------%\r\n\r\nmodel;\r\n\r\n// exogenous variables\r\nlog(teta)=(1-rhoteta)*log(tetass)+ rhoteta*log(teta(-1))+ sigteta*eteta;\r\n\r\n// Households\r\n(1-L)/c = varpi / w; \r\npi(+1)/r*exp(muz+sigz) = Qtilde;\r\nQtilde = (c(+1)/c)^(-psi) * ((1-L(+1))/(1-L))^(varpi*(1-psi)) * betateta * exp((1-psi)*muz)* (exp((1-gamma)*sigz)*v(+1)^(-chi))/(exp((1-gamma)*sigz)*v(+1)^(1-chi))^(-chi/(1-chi));\r\n(1-teta*bk)* (Qtilde*Rk(+1)*(u(+1) + 1/(delta0*eta*u(+1)^(eta-1)) * (1-delta0 * u(+1)^eta +tau*i(+1)/k * (i(+1)/k - iss/kss) - tau/2* (i(+1)/k - iss/kss)^2))) = Rk /(delta0*eta*u^(eta-1)) * exp(muz+sigz);\r\ndelta0*eta*u^(eta-1)/Rk = 1-tau*(i/k(-1) - iss/kss);\r\nv = (c * (1-L)^varpi)^(1-psi) + betateta * exp((1-psi)*muz) * (exp((1-psi)*(1-chi)*sigz) * v(+1)^(1-chi))^(1/(1-chi));\r\nk = (1-teta*bk)*(((1-delta0*u^eta) * k(-1) + (i/k(-1) - tau/2*((i/k(-1) - iss/kss)^2))*k(-1)))/(exp(muz+sigz));\r\nq = 1/(1-tau*(i/k(-1) - iss/kss));\r\nbetateta = beta0 * ((1 - teta + teta * exp((1-gamma)*log(1-bk)))^(1/(1-chi)));\r\n\r\n// Firms\r\ny = khat^alpha * L^(1-alpha) / Omega;\r\nw = mc * (1 - alpha) * (khat/L)^alpha;\r\nRk = mc * alpha * (khat/L)^(alpha-1);\r\nkhat = u*k(-1);\r\n\r\n// price setting\r\nA = exp(-muz) * (1 - teta + teta/(1-bk)) * exp(-sigz);\r\npireset = pi*upsilon/(upsilon-1)*X1/X2;\r\nX1 = y*mc + zeta*A*Qtilde*X1(+1)*pi(+1)^upsilon;\r\nX2 = y + zeta*A*Qtilde*X2(+1)*pi(+1)^(upsilon-1);\r\nOmega = (1-zeta)*pireset^(-upsilon)*pi^upsilon + zeta*pi^upsilon*Omega(-1);\r\npi^(1-upsilon) = (1-zeta)*pireset^(1-upsilon) + zeta;\r\n\r\n//Spreads\r\nrr = r/pi;\r\nSpr = Rk/rr;\r\n\r\n// markets\r\ny = c + i;\r\n\r\n// Monetary policy\r\nr= rhor*r(-1) + (1-rhor)*( phipi*(pi-piss) + phiy*(y-yss) + rss ) + sigr*er;\r\n\r\nend;\r\n\r\n%------------------------------------------------------------------------------------------%\r\n%                                 STEADY STATE INITIAL VALUES                              % \r\n%------------------------------------------------------------------------------------------%\r\n\r\ninitval;\r\ny = yss;\r\nc = css;\r\ni = iss;\r\nA = Ass;\r\nL = lss;\r\nu = uss;\r\nk = kss;\r\nkhat = khatss;\r\nOmega = omegass;\r\npi = piss;\r\npireset = piresetss;\r\nX1 = X1ss;\r\nX2 = X2ss;\r\nmc = mcss;\r\nw = wss;\r\nRk = rkss;\r\nteta = tetass;\r\nr = rss;\r\nq = qss;\r\nQtilde = Qtildess;\r\nbetateta = betatetass;\r\nv = vss;\r\nrr = rrss;\r\nSpr = sprss;\r\n\r\nend;\r\n\r\nshocks;\r\nvar eteta = sigteta^2;\r\nvar er = sigr^2;\r\nend;\r\n\r\nresid(1);\r\ncheck;\r\n\r\nsteady;\r\n\r\nstoch_simul(order=3,k_order_solver, IRF=20) ;\r\n```"},"comment":{"url":"https://api.github.com/repos/DynareTeam/dynare/issues/comments/83034781","html_url":"https://github.com/DynareTeam/dynare/issues/828#issuecomment-83034781","issue_url":"https://api.github.com/repos/DynareTeam/dynare/issues/828","id":83034781,"user":{"login":"houtanb","id":584723,"avatar_url":"https://avatars.githubusercontent.com/u/584723?v=3","gravatar_id":"","url":"https://api.github.com/users/houtanb","html_url":"https://github.com/houtanb","followers_url":"https://api.github.com/users/houtanb/followers","following_url":"https://api.github.com/users/houtanb/following{/other_user}","gists_url":"https://api.github.com/users/houtanb/gists{/gist_id}","starred_url":"https://api.github.com/users/houtanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houtanb/subscriptions","organizations_url":"https://api.github.com/users/houtanb/orgs","repos_url":"https://api.github.com/users/houtanb/repos","events_url":"https://api.github.com/users/houtanb/events{/privacy}","received_events_url":"https://api.github.com/users/houtanb/received_events","type":"User","site_admin":false},"created_at":"2015-03-18T16:01:21Z","updated_at":"2015-03-18T16:01:21Z","body":"A TLException is thrown during the call to ```md.insert(mdTi);``` in ```KordpDynare::populateDerivativesContainer``` in ```k_ord_dynare.cc```.\r\n\r\nI don't have a ready explanation as to why this exception is not caught, as all of this code is being called in a try/catch block and TLExceptions are among those exceptions that are caught"}}