Commit bfa4107a authored by Houtan Bastani's avatar Houtan Bastani
Browse files

Add copyright/license

parent 70f5f20e
% ---------------------------------------------------
% DMMgraphs read DMM output and makes graphs of
% model parameters and unobsevables
% A. Rossi, November 2014
% ------------------------------------------------------------------------
% DMMgraphs read DMM output and makes graphs of model parameters and unobsevables
%
% Copyright (C) 2010-2014 European Commission
%
% This file is part of Program DMM
%
% DMM is free software developed at the Joint Research Centre of the
% European Commission: 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.
%
% DMM 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 DMM. If not, see <http://www.gnu.org/licenses/>.
% --------------------------------------------------------------------------
% ---------- to be set by the user ---------------------------------------
path = 'h:\arossi\dmm\nile\'; % location of the .nml file e.g. nile.nml
......
function y = dmmprior(x,a,b,tipo)
% ------------------------------------------------------------------------
% tipo: NT normal, BE beta, IG inverted gamma 2 pdf
% A.Rossi (November 2014)
y = zeros(size(x));
%
% Copyright (C) 2010-2014 European Commission
%
% This file is part of Program DMM
%
% DMM is free software developed at the Joint Research Centre of the
% European Commission: 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.
%
% DMM 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 DMM. If not, see <http://www.gnu.org/licenses/>.
% --------------------------------------------------------------------------
y = zeros(size(x));
if nargin ~= 4,
error('dmmprior requires 4 input arguments');
end
......
% Usage: function [x,fx] = ker1boun(serie,h,step,minb,maxb)
% A. Rossi, November 2014
function [x,fx] = ker1boun(serie,h,step,minb,maxb)
% ------------------------------------------------------------------------
% Usage: function [x,fx] = ker1boun(serie,h,step,minb,maxb)
%
% Copyright (C) 2010-2014 European Commission
%
% This file is part of Program DMM
%
% DMM is free software developed at the Joint Research Centre of the
% European Commission: 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.
%
% DMM 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 DMM. If not, see <http://www.gnu.org/licenses/>.
% --------------------------------------------------------------------------
ll = length(serie);
llh = ll*h;
x = (minb:step:maxb)';
for ii=1:length(x)
g = (1/sqrt(2*pi))*exp(-.5*(((serie-x(ii))/h).^2));
fx(ii,1) = sum(g)/llh;
end
\ No newline at end of file
end
% Percentiles at m and M /% and iqr
% A. Rossi, November 2014
function [prc,iqr] = myprc(Y,NHIST,m,M)
% ------------------------------------------------------------------------
% Percentiles at m and M /% and iqr
%
% Copyright (C) 2010-2014 European Commission
%
% This file is part of Program DMM
%
% DMM is free software developed at the Joint Research Centre of the
% European Commission: 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.
%
% DMM 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 DMM. If not, see <http://www.gnu.org/licenses/>.
% --------------------------------------------------------------------------
[N,X] = hist(Y,NHIST);
NC = cumsum(N)/length(Y);
aa = find(NC<m);
......@@ -15,4 +35,4 @@ if isempty(aa) == 1
else
prc(2,1) = X(min(aa));
end
iqr = X(min(find(NC>.75)))-X(max(find(NC<.25)));
\ No newline at end of file
iqr = X(min(find(NC>.75)))-X(max(find(NC<.25)));
% nr number of rows, nc number of cols;
function [nr,nc] = numsubplot(n)
% ------------------------------------------------------------------------
% nr number of rows, nc number of cols
%
% Copyright (C) 2010-2014 European Commission
%
% This file is part of Program DMM
%
% DMM is free software developed at the Joint Research Centre of the
% European Commission: 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.
%
% DMM 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 DMM. If not, see <http://www.gnu.org/licenses/>.
% --------------------------------------------------------------------------
if n <= 64
if n == 1
nr = 1;
......
function [lab] =plotlabsmall(annoi,stperi,nobs,freq)
% ------------------------------------------------------------------------
% Create labels for plotting
% By A.Rossi, 2001
% Usage [lab] =plotlab(annoi,stperi,nobs,freq);
% INPUT: annoi = starting year;
% stperi = starting period;
% nobs = # of obs;
% freq = frequency (1 4 12).
function [lab] =plotlabsmall(annoi,stperi,nobs,freq)
%
% Copyright (C) 2010-2014 European Commission
%
% This file is part of Program DMM
%
% DMM is free software developed at the Joint Research Centre of the
% European Commission: 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.
%
% DMM 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 DMM. If not, see <http://www.gnu.org/licenses/>.
% --------------------------------------------------------------------------
anno=annoi;
stper=stperi;
lab=cell(nobs,1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment