undoing r2110 and r2111 changesets
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2112 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
464e29706f
commit
a03af050af
|
@ -1,44 +1,51 @@
|
|||
// example 1 from Collard's guide to Dynare
|
||||
var y, c, k, a, h, b;
|
||||
varexo e,u;
|
||||
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
|
||||
|
||||
parameters beta, rho, beta, alpha, delta, theta, psi, tau;
|
||||
|
||||
alpha = 0.36;
|
||||
rho = 0.95;
|
||||
tau = 0.025;
|
||||
beta = 0.99;
|
||||
delta = 0.025;
|
||||
psi = 0;
|
||||
theta = 2.95;
|
||||
|
||||
phi = 0.1;
|
||||
|
||||
model;
|
||||
c*theta*h^(1+psi)=(1-alpha)*y;
|
||||
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
|
||||
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
|
||||
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
|
||||
k = exp(b)*(y-c)+(1-delta)*k(-1);
|
||||
a = rho*a(-1)+tau*b(-1) + e;
|
||||
b = tau*a(-1)+rho*b(-1) + u;
|
||||
end;
|
||||
|
||||
initval;
|
||||
y = 1.08068253095672;
|
||||
c = 0.80359242014163;
|
||||
h = 0.29175631001732;
|
||||
k = 5;
|
||||
a = 0;
|
||||
b = 0;
|
||||
e = 0;
|
||||
u = 0;
|
||||
end;
|
||||
|
||||
shocks;
|
||||
var e; stderr 0.009;
|
||||
var u; stderr 0.009;
|
||||
var e, u = phi*0.009*0.009;
|
||||
end;
|
||||
|
||||
stoch_simul(periods=2100);
|
||||
\f0\fs24 \cf0 // example 1 from Collard's guide to Dynare
\
|
||||
var y, c, k, a, h, b;
\
|
||||
varexo e,u;
\
|
||||
\
|
||||
parameters beta, rho, beta, alpha, delta, theta, psi, tau;
\
|
||||
\
|
||||
alpha = 0.36;
\
|
||||
rho = 0.95;
\
|
||||
tau = 0.025;
\
|
||||
beta = 0.99;
\
|
||||
delta = 0.025;
\
|
||||
psi = 0;
\
|
||||
theta = 2.95;
\
|
||||
\
|
||||
phi = 0.1;
\
|
||||
\
|
||||
model;
\
|
||||
c*theta*h^(1+psi)=(1-alpha)*y;
\
|
||||
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
\
|
||||
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
\
|
||||
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
\
|
||||
k = exp(b)*(y-c)+(1-delta)*k(-1);
\
|
||||
a = rho*a(-1)+tau*b(-1) + e;
\
|
||||
b = tau*a(-1)+rho*b(-1) + u;
\
|
||||
end;
\
|
||||
\
|
||||
initval;
\
|
||||
y = 1.08068253095672;
\
|
||||
c = 0.80359242014163;
\
|
||||
h = 0.29175631001732;
\
|
||||
k = 5;
\
|
||||
a = 0;
\
|
||||
b = 0;
\
|
||||
e = 0;
\
|
||||
u = 0;
\
|
||||
end;
\
|
||||
\
|
||||
shocks;
\
|
||||
var e; stderr 0.009;
\
|
||||
var u; stderr 0.009;
\
|
||||
var e, u = phi*0.009*0.009;
\
|
||||
end;
\
|
||||
\
|
||||
stoch_simul(periods=2100);
\
|
||||
}
|
|
@ -1,40 +1,40 @@
|
|||
var y c k i l y_l w r z;
|
||||
varexo e;
|
||||
parameters beta psi delta alpha rho epsilon;
|
||||
|
||||
model;
|
||||
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
|
||||
psi*c/(1-l) = w;
|
||||
c+i = y;
|
||||
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
|
||||
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
|
||||
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
|
||||
i = k-(1-delta)*k(-1);
|
||||
y_l = y/l;
|
||||
z = rho*z(-1)+e;
|
||||
var y c k i l y_l w r z;
|
||||
varexo e;
|
||||
parameters beta psi delta alpha rho epsilon;
|
||||
|
||||
model;
|
||||
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
|
||||
psi*c/(1-l) = w;
|
||||
c+i = y;
|
||||
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
|
||||
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
|
||||
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
|
||||
i = k-(1-delta)*k(-1);
|
||||
y_l = y/l;
|
||||
z = rho*z(-1)+e;
|
||||
end;
|
||||
|
||||
varobs y;
|
||||
|
||||
initval;
|
||||
k = 9;
|
||||
c = 0.76;
|
||||
l = 0.3;
|
||||
w = 2.07;
|
||||
r = 0.03;
|
||||
z = 0;
|
||||
e = 0;
|
||||
end;
|
||||
|
||||
estimated_params;
|
||||
alpha, beta_pdf, 0.35, 0.02;
|
||||
beta, beta_pdf, 0.99, 0.002;
|
||||
delta, beta_pdf, 0.025, 0.003;
|
||||
psi, gamma_pdf, 1.75, 0.02;
|
||||
rho, beta_pdf, 0.95, 0.05;
|
||||
epsilon, gamma_pdf, 10, 0.003;
|
||||
stderr e, inv_gamma_pdf, 0.01, inf;
|
||||
end;
|
||||
|
||||
|
||||
estimation(datafile=simuldataRBC,nobs=200,first_obs=500,mh_replic=2000,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.8);
|
||||
varobs y;
|
||||
|
||||
initval;
|
||||
k = 9;
|
||||
c = 0.76;
|
||||
l = 0.3;
|
||||
w = 2.07;
|
||||
r = 0.03;
|
||||
z = 0;
|
||||
e = 0;
|
||||
end;
|
||||
|
||||
estimated_params;
|
||||
alpha, beta_pdf, 0.35, 0.02;
|
||||
beta, beta_pdf, 0.99, 0.002;
|
||||
delta, beta_pdf, 0.025, 0.003;
|
||||
psi, gamma_pdf, 1.75, 0.02;
|
||||
rho, beta_pdf, 0.95, 0.05;
|
||||
epsilon, gamma_pdf, 10, 0.003;
|
||||
stderr e, inv_gamma_pdf, 0.01, inf;
|
||||
end;
|
||||
|
||||
|
||||
estimation(datafile=simuldataRBC,nobs=200,first_obs=500,mh_replic=2000,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.8);
|
||||
|
|
|
@ -1,47 +1,133 @@
|
|||
// Adapted from Jesus Fernandez-Villaverde, Basic RBC Model with Monopolistic Competion Philadelphia, March 3, 2005
|
||||
|
||||
var y c k i l y_l w r z;
|
||||
varexo e;
|
||||
parameters beta psi delta alpha rho gamma sigma epsilon;
|
||||
|
||||
alpha = 0.33;
|
||||
beta = 0.99;
|
||||
delta = 0.023;
|
||||
psi = 1.75;
|
||||
rho = 0.95;
|
||||
sigma = (0.007/(1-alpha));
|
||||
epsilon = 10;
|
||||
|
||||
model;
|
||||
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
|
||||
psi*c/(1-l) = w;
|
||||
c+i = y;
|
||||
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
|
||||
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
|
||||
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
|
||||
i = k-(1-delta)*k(-1);
|
||||
y_l = y/l;
|
||||
z = rho*z(-1)+e;
|
||||
end;
|
||||
|
||||
initval;
|
||||
k = 9;
|
||||
c = 0.76;
|
||||
l = 0.3;
|
||||
w = 2.07;
|
||||
r = 0.03;
|
||||
z = 0;
|
||||
e = 0;
|
||||
end;
|
||||
|
||||
// Adapted from Jesus Fernandez-Villaverde, Basic RBC Model with Monopolistic Competion Philadelphia, March 3, 2005
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var y c k i l y_l w r z;
|
||||
|
||||
|
||||
varexo e;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
parameters beta psi delta alpha rho gamma sigma epsilon;
|
||||
|
||||
|
||||
|
||||
alpha = 0.33;
|
||||
|
||||
|
||||
beta = 0.99;
|
||||
|
||||
|
||||
delta = 0.023;
|
||||
|
||||
|
||||
psi = 1.75;
|
||||
|
||||
|
||||
rho = 0.95;
|
||||
|
||||
|
||||
sigma = (0.007/(1-alpha));
|
||||
|
||||
|
||||
epsilon = 10;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
model;
|
||||
|
||||
|
||||
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
|
||||
|
||||
|
||||
psi*c/(1-l) = w;
|
||||
|
||||
|
||||
c+i = y;
|
||||
|
||||
|
||||
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
|
||||
|
||||
|
||||
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
|
||||
|
||||
|
||||
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
|
||||
|
||||
|
||||
i = k-(1-delta)*k(-1);
|
||||
|
||||
|
||||
y_l = y/l;
|
||||
|
||||
|
||||
z = rho*z(-1)+e;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
||||
initval;
|
||||
|
||||
|
||||
k = 9;
|
||||
|
||||
|
||||
c = 0.76;
|
||||
|
||||
|
||||
l = 0.3;
|
||||
|
||||
|
||||
w = 2.07;
|
||||
|
||||
|
||||
r = 0.03;
|
||||
|
||||
|
||||
z = 0;
|
||||
|
||||
|
||||
e = 0;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
steady;
|
||||
|
||||
check;
|
||||
|
||||
shocks;
|
||||
var e = sigma^2;
|
||||
end;
|
||||
|
||||
stoch_simul(periods=2100);
|
||||
|
||||
|
||||
check;
|
||||
|
||||
|
||||
|
||||
|
||||
shocks;
|
||||
|
||||
|
||||
var e = sigma^2;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
steady;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
stoch_simul(periods=2100);
|
||||
|
||||
|
||||
|
|
|
@ -31,8 +31,6 @@ function CutSample(M_, options_, estim_params_)
|
|||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
global M_ options_ estim_params_
|
||||
|
||||
npar = estim_params_.np+estim_params_.nvn+estim_params_.ncx+estim_params_.ncn+estim_params_.nvx;
|
||||
|
||||
DirectoryName = CheckPath('metropolis');
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
function moments=compute_model_moments(dr,SelectVariables,M_,options_)
|
||||
%function moments=compute_model_moments(dr,M_,options_)
|
||||
function moments=compute_model_moments(dr,M_,options,_)
|
||||
%
|
||||
% INPUTS
|
||||
% dr: structure describing model solution
|
||||
% SelectVariables: indices of selected variables
|
||||
% M_: structure of Dynare options
|
||||
% options_
|
||||
%
|
||||
|
@ -30,4 +28,4 @@ function moments=compute_model_moments(dr,SelectVariables,M_,options_)
|
|||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
moments = th_autocovariances(dr,SelectVariables,M_,options_);
|
||||
moments = th_autocovariances(dr,options_.varlist,M_,options_);
|
||||
|
|
Binary file not shown.
|
@ -99,19 +99,6 @@ if ~(exist('stab_map_','file')==6 | exist('stab_map_','file')==2),
|
|||
end
|
||||
end
|
||||
|
||||
if ~(exist('gsa_sdp','file')==6 | exist('gsa_sdp','file')==2),
|
||||
dynare_root = strrep(which('dynare.m'),'dynare.m','');
|
||||
ss_anova_path = [dynare_root 'gsa/ss_anova_recurs'];
|
||||
if exist(ss_anova_path)
|
||||
addpath(ss_anova_path,path)
|
||||
else
|
||||
disp('Download Dynare sensitivity routines at:')
|
||||
disp('http://eemc.jrc.ec.europa.eu/softwareDYNARE-Dowload.htm')
|
||||
disp(' ' )
|
||||
error('Mapping routines missing!')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if options_gsa.morris,
|
||||
options_gsa.redform=1;
|
||||
|
|
|
@ -1,144 +0,0 @@
|
|||
function PosteriorOddsTable = model_comparison(ModelNames,ModelPriors,oo,options_,fname)
|
||||
% Bayesian model comparison. This function computes Odds ratios and
|
||||
% estimate a posterior density over a colletion of models.
|
||||
%
|
||||
% INPUTS
|
||||
% ModelNames [string] m*1 cell array of string.
|
||||
% ModelPriors [double] m*1 vector of prior probabilities
|
||||
%
|
||||
% OUTPUTS
|
||||
% none
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% none
|
||||
|
||||
% Copyright (C) 2007-2008 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
NumberOfModels = size(ModelNames,2);
|
||||
|
||||
disp(' ')
|
||||
disp(' ')
|
||||
if isempty(ModelPriors)
|
||||
prior_flag = 0;% empty_prior=0
|
||||
ModelPriors = ones(NumberOfModels,1)/NumberOfModels;
|
||||
else % The prior density has to sum up to one.
|
||||
prior_flag = 1;
|
||||
improper = abs(sum(ModelPriors)-1)>1e-6;
|
||||
if improper
|
||||
disp('model_comparison:: The user supplied prior distribution over models is improper...')
|
||||
disp('model_comparison:: The distribution is automatically rescaled!')
|
||||
ModelPriors=ModelPriors/sum(ModelPriors);
|
||||
end
|
||||
end
|
||||
|
||||
% The marginal densities are based on Laplace approxiations (default) or
|
||||
% modified harmonic mean estimators.
|
||||
if isfield(options_,'model_comparison_approximation')
|
||||
type = options_.model_comparison_approximation;
|
||||
if strcmp(type,'Laplace')
|
||||
type = 'LaplaceApproximation';
|
||||
end
|
||||
else
|
||||
type = 'LaplaceApproximation';
|
||||
end
|
||||
|
||||
% Get the estimated logged marginal densities.
|
||||
MarginalLogDensity = zeros(NumberOfModels,1);
|
||||
ShortModelNames = get_short_names(ModelNames);
|
||||
iname = strmatch(fname,ShortModelNames,'exact');
|
||||
|
||||
for i=1:NumberOfModels
|
||||
if i==iname
|
||||
mstruct.oo_ = oo;
|
||||
else
|
||||
if strcmpi(ModelNames{i}(end-3:end),'.mod') | strcmpi(ModelNames{i}(end-3:end),'.dyn')
|
||||
mstruct = load([ModelNames{i}(1:end-4) '_results.mat' ],'oo_');
|
||||
else
|
||||
mstruct = load([ModelNames{i} '_results.mat' ],'oo_');
|
||||
end
|
||||
end
|
||||
try
|
||||
eval(['MarginalLogDensity(i) = mstruct.oo_.MarginalDensity.' type ';'])
|
||||
catch
|
||||
if strcmpi(type,'LaplaceApproximation')
|
||||
disp(['MODEL_COMPARISON: I cant''t find the Laplace approximation associated to model ' ModelNames{i}])
|
||||
return
|
||||
elseif strcmpi(type,'ModifiedHarmonicMean')
|
||||
disp(['MODEL_COMPARISON: I cant''t find the modified harmonic mean estimate associated to model ' ModelNames{i}])
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% In order to avoid overflow, we divide the numerator and the denominator
|
||||
% of the Posterior Odds Ratio by the largest Marginal Posterior Density
|
||||
lmpd = log(ModelPriors)+MarginalLogDensity;
|
||||
[maxval,k] = max(lmpd);
|
||||
elmpd = exp(lmpd-maxval);
|
||||
|
||||
|
||||
% Now I display the posterior probabilities.
|
||||
title = 'Model Comparison';
|
||||
headers = strvcat('Model',ShortModelNames{:});
|
||||
if prior_flag
|
||||
labels = strvcat('Priors','Log Marginal Density','Bayes Ratio', ...
|
||||
'Posterior Model Probability');
|
||||
values = [ModelPriors';MarginalLogDensity';exp(lmpd-lmpd(1))'; ...
|
||||
elmpd'/sum(elmpd)];
|
||||
else
|
||||
labels = strvcat('Priors','Log Marginal Density','Bayes Ratio','Posterior Odds Ratio', ...
|
||||
'Posterior Model Probability');
|
||||
values = [ModelPriors';MarginalLogDensity'; exp(MarginalLogDensity-MarginalLogDensity(1))'; ...
|
||||
exp(lmpd-lmpd(1))'; elmpd'/sum(elmpd)];
|
||||
end
|
||||
|
||||
table(title,headers,labels,values, 0, 15, 6);
|
||||
|
||||
|
||||
function name = get_model_name_without_path(modelname)
|
||||
idx = strfind(modelname,'\');
|
||||
if isempty(idx)
|
||||
idx = strfind(modelname,'/');
|
||||
end
|
||||
if isempty(idx)
|
||||
name = modelname;
|
||||
return
|
||||
end
|
||||
name = modelname(idx(end)+1:end);
|
||||
|
||||
|
||||
function name = get_model_name_without_extension(modelname)
|
||||
idx = strfind(modelname,'.mod');
|
||||
if isempty(idx)
|
||||
idx = strfind(modelname,'.dyn')
|
||||
end
|
||||
if isempty(idx)
|
||||
name = modelname;
|
||||
return
|
||||
end
|
||||
name = modelname(1:end-4);
|
||||
|
||||
|
||||
function modellist = get_short_names(modelnames)
|
||||
n = length(modelnames);
|
||||
modellist = {};
|
||||
for i=1:n
|
||||
name = get_model_name_without_extension(modelnames{i});
|
||||
name = get_model_name_without_path(name);
|
||||
modellist = {modellist{:} name};
|
||||
end
|
|
@ -46,10 +46,10 @@ for k=1:size(s1,1)
|
|||
y = [y; oo_.endo_simul(strmatch(s1(k,:),M_.endo_names,'exact'),:)] ;
|
||||
end
|
||||
|
||||
if options_.dsample == 0
|
||||
if options_.smpl == 0
|
||||
i = [M_.maximum_lag:size(oo_.endo_simul,2)]' ;
|
||||
else
|
||||
i = [options_.dsample(1)+M_.maximum_lag:options_.dsample(2)+M_.maximum_lag]' ;
|
||||
i = [options_.smpl(1)+M_.maximum_lag:options_.smpl(2)+M_.maximum_lag]' ;
|
||||
end
|
||||
|
||||
t = ['Plot of '] ;
|
||||
|
@ -86,6 +86,9 @@ elseif rplottype == 2
|
|||
end
|
||||
end
|
||||
|
||||
% 02/28/01 MJ replaced bseastr by MATLAB's strmatch
|
||||
% 06/19/01 MJ added 'exact' to strmatch calls
|
||||
% 06/25/03 MJ correction when options_.smpl ~= 0
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -49,19 +49,7 @@ function steady()
|
|||
homotopy3(options_.homotopy_values, options_.homotopy_steps);
|
||||
end
|
||||
|
||||
if options_.homotopy_mode == 1
|
||||
homotopy1(options_.homotopy_param,options_.homotopy_exo, ...
|
||||
options_.homotopy_exodet,options_.homotopy_steps);
|
||||
elseif options_.homotopy_mode == 2
|
||||
homotopy2(options_.homotopy_param,options_.homotopy_exo, ...
|
||||
options_.homotopy_exodet,options_.homotopy_steps);
|
||||
elseif options_.homotopy_mode == 3
|
||||
homotopy3(options_.homotopy_param,options_.homotopy_exo, ...
|
||||
options_.homotopy_exodet,options_.homotopy_steps);
|
||||
else
|
||||
steady_;
|
||||
end
|
||||
|
||||
steady_;
|
||||
|
||||
disp(' ')
|
||||
disp('STEADY-STATE RESULTS:')
|
||||
|
|
|
@ -827,16 +827,16 @@ ModelComparisonStatement::writeOutput(ostream &output, const string &basename) c
|
|||
{
|
||||
options_list.writeOutput(output);
|
||||
|
||||
output << "ModelNames_ = {};" << endl;
|
||||
output << "ModelPriors_ = [];" << endl;
|
||||
output << "ModelNames_ = {};\n";
|
||||
output << "ModelPriors_ = {};\n";
|
||||
|
||||
for(filename_list_type::const_iterator it = filename_list.begin();
|
||||
it != filename_list.end(); it++)
|
||||
{
|
||||
output << "ModelNames_ = { ModelNames_{:} '" << it->first << "'};" << endl;
|
||||
output << "ModelPriors_ = [ ModelPriors_ ; " << it->second << "];" << endl;
|
||||
output << "ModelNames_ = { ModelNames_{:} '" << it->first << "};\n";
|
||||
output << "ModelPriors_ = { ModelPriors_{:} '" << it->second << "};\n";
|
||||
}
|
||||
output << "model_comparison(ModelNames_,ModelPriors_,oo_,options_,M_.fname);" << endl;
|
||||
output << "model_comparison(ModelNames_,ModelPriors_);\n";
|
||||
}
|
||||
|
||||
PlannerObjectiveStatement::PlannerObjectiveStatement(ModelTree *model_tree_arg) :
|
||||
|
|
|
@ -87,8 +87,7 @@ class ParsingDriver;
|
|||
%token CALIB CALIB_VAR CHECK CONF_SIG CONSTANT CORR COVAR CUTOFF
|
||||
%token DATAFILE DR_ALGO DROP DSAMPLE DYNASAVE DYNATYPE
|
||||
%token END ENDVAL EQUAL ESTIMATION ESTIMATED_PARAMS ESTIMATED_PARAMS_BOUNDS ESTIMATED_PARAMS_INIT
|
||||
%token <string_val> FILENAME
|
||||
%token FILENAME_KEYWORD FILTER_STEP_AHEAD FILTERED_VARS FIRST_OBS
|
||||
%token FILENAME FILTER_STEP_AHEAD FILTERED_VARS FIRST_OBS
|
||||
%token <string_val> FLOAT_NUMBER
|
||||
%token FORECAST
|
||||
%token GAMMA_PDF GAUSSIAN_ELIMINATION GCC_COMPILER GMRES GRAPH
|
||||
|
@ -97,11 +96,10 @@ class ParsingDriver;
|
|||
%token <string_val> INT_NUMBER
|
||||
%token INV_GAMMA1_PDF INV_GAMMA2_PDF IRF
|
||||
%token KALMAN_ALGO KALMAN_TOL
|
||||
%token LAPLACE LCC_COMPILER LIK_ALGO LIK_INIT LINEAR LOAD_MH_FILE LOGLINEAR LU
|
||||
%token MARKOWITZ MARGINAL_DENSITY MAX
|
||||
%token LAPLACE LCC_COMPILER LIK_ALGO LIK_INIT LINEAR LOAD_MH_FILE LOGLINEAR LU MARKOWITZ MAX
|
||||
%token METHOD MH_DROP MH_INIT_SCALE MH_JSCALE MH_MODE MH_NBLOCKS MH_REPLIC MH_RECOVER MIN
|
||||
%token MODE_CHECK MODE_COMPUTE MODE_FILE MODEL MODEL_COMPARISON MODEL_INFO MSHOCKS
|
||||
%token MODIFIEDHARMONICMEAN MOMENTS_VARENDO DIFFUSE_FILTER
|
||||
%token MODEL_COMPARISON_APPROXIMATION MODIFIEDHARMONICMEAN MOMENTS_VARENDO DIFFUSE_FILTER
|
||||
%token <string_val> NAME
|
||||
%token NO_COMPILER NOBS NOCONSTANT NOCORR NODIAGNOSTIC NOFUNCTIONS
|
||||
%token NOGRAPH NOMOMENTS NOPRINT NORMAL_PDF
|
||||
|
@ -137,7 +135,7 @@ class ParsingDriver;
|
|||
%type <node_val> expression
|
||||
%type <node_val> equation hand_side model_var
|
||||
%type <string_val> signed_float signed_integer prior
|
||||
%type <string_val> value value1 vec_int_elem vec_int_1 vec_int
|
||||
%type <string_val> value value1 filename filename_elem vec_int_elem vec_int_1 vec_int
|
||||
%type <string_val> vec_value_1 vec_value
|
||||
%type <string_val> calib_arg2 range number
|
||||
|
||||
|
@ -372,7 +370,7 @@ comma_expression : expression
|
|||
initval : INITVAL ';' initval_list END
|
||||
{ driver.end_initval(); }
|
||||
|
||||
initval_file : INITVAL_FILE '(' FILENAME_KEYWORD EQUAL NAME ')' ';'
|
||||
initval_file : INITVAL_FILE '(' FILENAME EQUAL NAME ')' ';'
|
||||
{ driver.initval_file($5); }
|
||||
;
|
||||
|
||||
|
@ -1119,25 +1117,44 @@ dynasave : DYNASAVE '(' NAME ')'';'
|
|||
{ driver.run_dynasave($2, $4); }
|
||||
;
|
||||
|
||||
model_comparison : MODEL_COMPARISON mc_filename_list ';'
|
||||
{ driver.run_model_comparison(); }
|
||||
| MODEL_COMPARISON '(' o_marginal_density ')' mc_filename_list ';'
|
||||
{ driver.run_model_comparison(); }
|
||||
;
|
||||
model_comparison : MODEL_COMPARISON '(' model_comparison_options ')' filename_list ';'
|
||||
{ driver.run_model_comparison(); };
|
||||
|
||||
mc_filename_list : FILENAME
|
||||
{ driver.add_mc_filename($1); }
|
||||
| FILENAME '(' value ')'
|
||||
{ driver.add_mc_filename($1, $3); }
|
||||
| mc_filename_list FILENAME
|
||||
{ driver.add_mc_filename($2); }
|
||||
| mc_filename_list FILENAME '(' value ')'
|
||||
{ driver.add_mc_filename($2, $4); }
|
||||
| mc_filename_list COMMA FILENAME
|
||||
{ driver.add_mc_filename($3); }
|
||||
| mc_filename_list COMMA FILENAME '(' value ')'
|
||||
{ driver.add_mc_filename($3, $5); }
|
||||
;
|
||||
model_comparison_options : model_comparison_options COMMA model_comparison_option
|
||||
| model_comparison_option
|
||||
;
|
||||
|
||||
model_comparison_option : o_model_comparison_approximation
|
||||
| o_print
|
||||
| o_noprint
|
||||
;
|
||||
|
||||
filename_list : filename
|
||||
{ driver.add_mc_filename($1); }
|
||||
| filename_list COMMA filename
|
||||
{ driver.add_mc_filename($3); }
|
||||
| filename '(' value ')'
|
||||
{ driver.add_mc_filename($1, $3); }
|
||||
| filename_list COMMA filename '(' value ')'
|
||||
{ driver.add_mc_filename($3, $5); }
|
||||
;
|
||||
|
||||
filename : filename_elem
|
||||
{ $$ = $1; }
|
||||
| filename filename_elem
|
||||
{ $1->append(*$2); delete $2; $$ = $1; }
|
||||
;
|
||||
|
||||
filename_elem : NAME
|
||||
| '\\'
|
||||
{ $$ = new string("\\"); }
|
||||
| DIVIDE
|
||||
{ $$ = new string("/"); }
|
||||
| ':'
|
||||
{ $$ = new string(":"); }
|
||||
| '.'
|
||||
{ $$ = new string("."); }
|
||||
;
|
||||
|
||||
planner_objective : PLANNER_OBJECTIVE { driver.begin_planner_objective(); }
|
||||
hand_side { driver.end_planner_objective($3); } ';';
|
||||
|
@ -1358,11 +1375,11 @@ o_filtered_vars : FILTERED_VARS { driver.option_num("filtered_vars", "1"); };
|
|||
o_relative_irf : RELATIVE_IRF { driver.option_num("relative_irf", "1"); };
|
||||
o_kalman_algo : KALMAN_ALGO EQUAL INT_NUMBER { driver.option_num("kalman_algo", $3); };
|
||||
o_kalman_tol : KALMAN_TOL EQUAL INT_NUMBER { driver.option_num("kalman_tol", $3); };
|
||||
o_marginal_density : MARGINAL_DENSITY EQUAL LAPLACE
|
||||
{ driver.option_str("mc_marginal_density", "laplace"); }
|
||||
| MARGINAL_DENSITY EQUAL MODIFIEDHARMONICMEAN
|
||||
{ driver.option_str("mc_marginal_density", "modifiedharmonicmean"); }
|
||||
;
|
||||
o_model_comparison_approximation : MODEL_COMPARISON_APPROXIMATION EQUAL LAPLACE
|
||||
{ driver.option_str("model_comparison_approximation", "Laplace"); }
|
||||
| MODEL_COMPARISON_APPROXIMATION EQUAL MODIFIEDHARMONICMEAN
|
||||
{ driver.option_str("model_comparison_approximation", "MODIFIEDHARMONICMEAN"); }
|
||||
;
|
||||
o_print : PRINT { driver.option_num("noprint", "0"); };
|
||||
o_noprint : NOPRINT { driver.option_num("noprint", "1"); };
|
||||
o_xls_sheet : XLS_SHEET EQUAL NAME { driver.option_str("xls_sheet", $3); };
|
||||
|
|
|
@ -204,13 +204,13 @@ int sigma_e = 0;
|
|||
<DYNARE_STATEMENT>periods {return token::PERIODS;}
|
||||
<DYNARE_STATEMENT>cutoff {return token::CUTOFF;}
|
||||
<DYNARE_STATEMENT>markowitz {return token::MARKOWITZ;}
|
||||
<DYNARE_STATEMENT>marginal_density {return token::MARGINAL_DENSITY;}
|
||||
<DYNARE_STATEMENT>model_comparison_approximation {return token::MODEL_COMPARISON;}
|
||||
<DYNARE_STATEMENT>laplace {return token::LAPLACE;}
|
||||
<DYNARE_STATEMENT>modifiedharmonicmean {return token::MODIFIEDHARMONICMEAN;}
|
||||
<DYNARE_STATEMENT>constant {return token::CONSTANT;}
|
||||
<DYNARE_STATEMENT>noconstant {return token::NOCONSTANT;}
|
||||
<DYNARE_STATEMENT>covar {return token::COVAR;}
|
||||
<DYNARE_STATEMENT>filename {return token::FILENAME_KEYWORD;}
|
||||
<DYNARE_STATEMENT>filename {return token::FILENAME;}
|
||||
<DYNARE_STATEMENT>diffuse_filter {return token::DIFFUSE_FILTER;}
|
||||
|
||||
<DYNARE_STATEMENT>bvar_prior_tau { return token::BVAR_PRIOR_TAU; }
|
||||
|
@ -380,11 +380,6 @@ int sigma_e = 0;
|
|||
return token::INT_NUMBER;
|
||||
}
|
||||
|
||||
<DYNARE_STATEMENT,DYNARE_BLOCK>[A-Za-z0-9_/:\\\.]+ {
|
||||
yylval->string_val = new string(yytext);
|
||||
return token::FILENAME;
|
||||
}
|
||||
|
||||
/* an instruction starting with a recognized symbol (which is not a modfile local variable)
|
||||
is passed as NAME,
|
||||
otherwise it is a native statement until the end of the line
|
||||
|
|
|
@ -292,7 +292,7 @@ public:
|
|||
class ModelComparisonStatement : public Statement
|
||||
{
|
||||
public:
|
||||
typedef map<string, string> filename_list_type;
|
||||
typedef map<string, string, less<string> > filename_list_type;
|
||||
private:
|
||||
filename_list_type filename_list;
|
||||
OptionsList options_list;
|
||||
|
|
|
@ -3,11 +3,11 @@ varexo e_x e_y;
|
|||
|
||||
parameters rho_x rho_y;
|
||||
|
||||
rho_x = 0.5; // comment 1
|
||||
rho_x = 0.5;
|
||||
rho_y = -0.3;
|
||||
|
||||
model;
|
||||
dx = rho_x*dx(-1)+e_x; // comment 2
|
||||
dx = rho_x*dx(-1)+e_x;
|
||||
dy = rho_y*dy(-1)+e_y;
|
||||
end;
|
||||
|
||||
|
@ -20,4 +20,4 @@ end;
|
|||
|
||||
varobs dx dy;
|
||||
check;
|
||||
estimation(datafile=data1,nobs=1000,mh_replic=2000,mh_jscale=1.2);
|
||||
estimation(datafile=data1,nobs=1000,mh_replic=2000);
|
|
@ -24,4 +24,4 @@ end;
|
|||
|
||||
varobs x y;
|
||||
unit_root_vars x y;
|
||||
estimation(datafile=data1,nobs=1000,mh_replic=2000,diffuse_filter);
|
||||
estimation(datafile=data1,nobs=1000,mh_replic=2000,lik_init=2);
|
|
@ -30,4 +30,4 @@ end;
|
|||
varobs dx dy;
|
||||
|
||||
unit_root_vars x y;
|
||||
estimation(datafile=data2,nobs=100,mh_replic=0,diffuse_filter);
|
||||
estimation(datafile=data2,nobs=100,mh_replic=0,lik_init=2);
|
||||
|
|
|
@ -29,4 +29,5 @@ end;
|
|||
|
||||
varobs x y;
|
||||
|
||||
estimation(datafile=data2,nobs=100,mh_replic=0,mh_nblocks=1);
|
||||
unit_root_vars x y;
|
||||
estimation(datafile=data2,nobs=100,mh_replic=0,lik_init=2);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// example 1 from Collard's guide to Dynare
|
||||
var y, c, k, a, h, b;
|
||||
varexo u, e;
|
||||
varexo e,u;
|
||||
|
||||
parameters beta, rho, alpha, delta, theta, psi, tau, phi;
|
||||
|
||||
|
@ -36,13 +36,9 @@ u = 0;
|
|||
end;
|
||||
|
||||
shocks;
|
||||
var e; stderr 0.018;
|
||||
var e; stderr 0.009;
|
||||
var u; stderr 0.009;
|
||||
var e, u = phi*0.018*0.009;
|
||||
var e, u = phi*0.009*0.009;
|
||||
end;
|
||||
|
||||
rhos = 0.8:0.05:0.8;
|
||||
for i=1:length(rhos);
|
||||
rho = rhos(i);
|
||||
stoch_simul(order=2);
|
||||
end;
|
||||
stoch_simul;
|
||||
|
|
|
@ -72,8 +72,6 @@ var e_a; stderr 0.014;
|
|||
var e_m; stderr 0.005;
|
||||
end;
|
||||
|
||||
unit_root_vars P_obs Y_obs;
|
||||
|
||||
steady;
|
||||
|
||||
check;
|
||||
|
@ -97,7 +95,8 @@ P_obs (log(mst)-gam);
|
|||
Y_obs (gam);
|
||||
end;
|
||||
|
||||
unit_root_vars P_obs Y_obs;
|
||||
|
||||
//stoch_simul(order=1,nomoments,irf=0);
|
||||
estimation(datafile=fsdat,nobs=192,loglinear,mh_replic=2000,mh_nblocks=2,mh_jscale=0.8,mode_compute=0,mode_file=fs2000b_mode,kalman_algo=4);
|
||||
|
||||
estimation(datafile=fsdat,nobs=192,loglinear,mh_replic=0,mh_nblocks=2,mh_drop=0.45,mode_compute=0,mode_file=fs2000b_mode,load_mh_file);
|
||||
stab_map_;
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
global options_ M_
|
||||
load test
|
||||
% $$$ Y = Y(1:2,:);
|
||||
% $$$ mf = mf(1:2);
|
||||
% $$$ H=H(1:2,1:2);
|
||||
% $$$ pp = pp-1;
|
||||
% $$$ trend =trend(1:2,:);
|
||||
M_.fname = ' ';
|
||||
global_initialization;
|
||||
options_.nk = 1;
|
||||
Pinf1(1,1) = 1;
|
||||
Pstar1(1,1) = 0;
|
||||
Pstar1(5,1) = 0;
|
||||
Pstar1(1,5) = 0;
|
||||
Pstar1(4,1) = 0;
|
||||
Pstar1(1,4) = 0;
|
||||
[alphahat1,epsilonhat1,etahat1,a11, aK1] = DiffuseKalmanSmootherH1(T,R,Q,H, ...
|
||||
Pinf1,Pstar1,Y,trend,pp,mm,smpl,mf);
|
||||
[alphahat2,epsilonhat2,etahat2,a12, aK2] = DiffuseKalmanSmootherH3(T,R,Q,H, ...
|
||||
|
@ -22,7 +18,21 @@ max(max(abs(epsilonhat1-epsilonhat2)))
|
|||
max(max(abs(etahat1-etahat2)))
|
||||
max(max(abs(a11-a12)))
|
||||
max(max(abs(aK1-aK2)))
|
||||
|
||||
return
|
||||
[alphahat1,etahat1,a11, aK1] = DiffuseKalmanSmoother1(T,R,Q, ...
|
||||
Pinf1,Pstar1,Y,trend,pp,mm,smpl,mf);
|
||||
[alphahat2,etahat2,a12, aK2] = DiffuseKalmanSmoother3(T,R,Q, ...
|
||||
Pinf1,Pstar1,Y,trend, ...
|
||||
pp,mm,smpl,mf);
|
||||
|
||||
|
||||
max(max(abs(alphahat1-alphahat2)))
|
||||
max(max(abs(etahat1-etahat2)))
|
||||
max(max(abs(a11-a12)))
|
||||
%max(max(abs(aK1-aK2)))
|
||||
|
||||
|
||||
H = zeros(size(H));
|
||||
[alphahat1,etahat1,a11, aK1] = DiffuseKalmanSmoother1(T,R,Q, ...
|
||||
Pinf1,Pstar1,Y,trend,pp,mm,smpl,mf);
|
||||
|
@ -44,29 +54,3 @@ max(max(abs(alphahat1-alphahat2)))
|
|||
max(max(abs(etahat1-etahat2)))
|
||||
max(max(abs(a11-a12)))
|
||||
%max(max(abs(aK1-aK2)))
|
||||
|
||||
Pinf1 = zeros(5,5);
|
||||
Pinf1(1,1) = 1;
|
||||
a=0.3*randn(4,4);
|
||||
Pstar1 = [zeros(1,5); [zeros(4,1) a'*a]];
|
||||
T = 0.8*eye(5);
|
||||
T(1,1) = 1;
|
||||
Y = Y(1,:);
|
||||
mf = 1;
|
||||
pp = 1;
|
||||
trend = trend(1,:);
|
||||
options_.diffuse_d = 1;
|
||||
|
||||
[alphahat1,etahat1,a11, aK1] = DiffuseKalmanSmoother1(T,R,Q, ...
|
||||
Pinf1,Pstar1,Y,trend,pp,mm,smpl,mf);
|
||||
[alphahat2,etahat2,a12, aK2] = DiffuseKalmanSmoother3(T,R,Q, ...
|
||||
Pinf1,Pstar1,Y,trend, ...
|
||||
pp,mm,smpl,mf);
|
||||
|
||||
|
||||
max(max(abs(alphahat1-alphahat2)))
|
||||
max(max(abs(etahat1-etahat2)))
|
||||
max(max(abs(a11-a12)))
|
||||
%max(max(abs(aK1-aK2)))
|
||||
return
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ oc = c;
|
|||
oh = h;
|
||||
end;
|
||||
|
||||
//steady;
|
||||
//check;
|
||||
steady;
|
||||
check;
|
||||
|
||||
estimated_params;
|
||||
theta , 0.22, 0.1, 0.5;
|
||||
|
@ -87,5 +87,4 @@ oy (log(eta));
|
|||
oc (log(eta));
|
||||
end;
|
||||
|
||||
//options_.debug=1;
|
||||
estimation(datafile=idata,mode_compute=4,nograph);
|
||||
estimation(datafile=idata,mode_compute=1,nograph);
|
|
@ -87,5 +87,4 @@ oy (log(eta));
|
|||
oc (log(eta));
|
||||
end;
|
||||
|
||||
warning off;
|
||||
estimation(datafile=idata,mode_compute=4,nograph);
|
||||
estimation(datafile=idata,nograph);
|
|
@ -26,7 +26,7 @@ check;
|
|||
|
||||
shocks;
|
||||
var x;
|
||||
periods 10;
|
||||
periods 1;
|
||||
values 1.2;
|
||||
end;
|
||||
|
||||
|
|
132
tests/run_test.m
132
tests/run_test.m
|
@ -1,137 +1,39 @@
|
|||
function run_test()
|
||||
test_files = {
|
||||
'.' 'ramst';
|
||||
'.' 'ramst_a';
|
||||
'.' 'ramst';
|
||||
'.' 'ramst_a';
|
||||
'.' 'example1';
|
||||
%'.' 'example2';
|
||||
'.' 't_sgu_ex1';
|
||||
'arima' 'mod1';
|
||||
'arima' 'mod1a';
|
||||
'arima' 'mod1b';
|
||||
'arima' 'mod1c';
|
||||
'arima' 'mod2';
|
||||
'arima' 'mod2a';
|
||||
'arima' 'mod2b';
|
||||
'arima' 'mod2c';
|
||||
'fs2000' 'fs2000';
|
||||
'fs2000' 'fs2000a';
|
||||
'estimation_options','fs2000A';
|
||||
'estimation_options','fs2000B';
|
||||
}
|
||||
'.' 'example2';
|
||||
'.' 't_sgu_ex1';
|
||||
'arima' 'mod1';
|
||||
'arima' 'mod1a';
|
||||
'arima' 'mod1b';
|
||||
'arima' 'mod1c';
|
||||
'arima' 'mod2';
|
||||
'arima' 'mod2a';
|
||||
'arima' 'mod2b';
|
||||
'arima' 'mod2c';
|
||||
'fs2000' 'fs2000';
|
||||
'fs2000' 'fs2000a';
|
||||
}
|
||||
|
||||
results = cell(length(test_files),1);
|
||||
|
||||
for i=1:length(test_files)
|
||||
tic;
|
||||
rand('state',1);
|
||||
randn('state',1);
|
||||
results{i}= run_test1(test_files{i,1},test_files{i,2});
|
||||
|
||||
toc;
|
||||
|
||||
end
|
||||
|
||||
|
||||
for i=1:length(test_files)
|
||||
disp(test_files{i,2})
|
||||
disp(results{i})
|
||||
disp(toc)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function msg=run_test1(path1,mod_file)
|
||||
global options_ oo_
|
||||
options_=struct('trick',1);
|
||||
oo_=struct('trick',1);
|
||||
global options_
|
||||
clear options_
|
||||
old_path = pwd;
|
||||
cd(path1);
|
||||
msg = 'OK';
|
||||
expr = ['disp(''error in ' mod_file ''');msg=lasterr;disp(msg)'];
|
||||
|
||||
try
|
||||
old_results=load([mod_file '_results']);
|
||||
catch
|
||||
eval(['dynare ' mod_file ' noclearall'],'eval(expr)');
|
||||
msg = 'no previous results'
|
||||
cd(old_path)
|
||||
return
|
||||
end
|
||||
eval(['dynare ' mod_file ' noclearall'],'eval(expr)');
|
||||
msg = strvcat(msg, comparison(oo_,old_results.oo_,0, 'oo_'));
|
||||
cd(old_path)
|
||||
end
|
||||
|
||||
function msg=comparison(A,B,tol,parent)
|
||||
|
||||
msg = '';
|
||||
mca = my_class(A);
|
||||
mcb = my_class(B);
|
||||
if size(mca,2) ~= size(mcb,2) || any(mca ~= mcb)
|
||||
msg = ['Types differ in ' parent];
|
||||
return
|
||||
end
|
||||
|
||||
switch my_class(A)
|
||||
case 'numeric'
|
||||
if size(A)==size(B)
|
||||
if ~all(all(abs(A-B)<tol))
|
||||
msg = ['Difference greater than tolerance in ' parent];
|
||||
end
|
||||
else
|
||||
msg = ['Sizes differ in ' parent];
|
||||
end
|
||||
case 'char'
|
||||
if A~=B
|
||||
msg = ['Strings differ in ' parent];
|
||||
end
|
||||
case 'cell'
|
||||
if size(A) == size(B)
|
||||
[M,N] = size(A);
|
||||
for i = 1:M
|
||||
for j = 1:N
|
||||
msg = strvcat(msg, comparison(A{i,j}, B{i,j}, tol, sprintf('%s{%d,%d}', parent, i, j)))
|
||||
end
|
||||
end
|
||||
else
|
||||
msg = [ 'Cell sizes differ in ' parent ];
|
||||
end
|
||||
case 'struct'
|
||||
|
||||
namesA=fieldnames(A);
|
||||
namesB=fieldnames(B);
|
||||
|
||||
if length(namesA)~=length(namesB)
|
||||
msg = [ 'Number of fields differ in ' parent ]
|
||||
return
|
||||
end
|
||||
|
||||
namesA = sort(namesA);
|
||||
namesB = sort(namesB);
|
||||
|
||||
for i=1:length(namesA)
|
||||
if namesA{i}==namesB{i}
|
||||
msg = strvcat(msg, comparison(A.(namesA{i}),B.(namesB{i}),tol, sprintf('%s.%s', parent, namesA{i})));
|
||||
else
|
||||
msg = strvcat(msg, sprintf('Field %s.%s in 1st arg does not exist in 2nd arg', parent, namesA{i}));
|
||||
end
|
||||
end
|
||||
|
||||
otherwise
|
||||
msg = ['Unsupported type in ' parent ];
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function t = my_class(a)
|
||||
c = class(a);
|
||||
if isequal(c, 'double') | isequal(c, 'single') | isequal(c, 'int8')| isequal(c, 'uint8') | ...
|
||||
isequal(c, 'int16') | isequal(c, 'uint16') | isequal(c, 'int32') | isequal(c, 'uint32') | ...
|
||||
isequal(c, 'int64') | isequal(c, 'uint64')
|
||||
t = 'numeric';
|
||||
else
|
||||
t = c;
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue