2015-07-23 17:32:09 +02:00
|
|
|
module DynareModel
|
|
|
|
##
|
|
|
|
# Copyright (C) 2015 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/>.
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2015-07-24 11:35:23 +02:00
|
|
|
export Endo, Exo, ExoDet, Param, model
|
2015-07-23 17:32:09 +02:00
|
|
|
|
|
|
|
abstract Atom
|
|
|
|
|
|
|
|
immutable Endo <: Atom
|
|
|
|
name::UTF8String
|
|
|
|
tex_name::UTF8String
|
|
|
|
long_name::UTF8String
|
|
|
|
end
|
|
|
|
|
|
|
|
immutable Exo <: Atom
|
|
|
|
name::UTF8String
|
|
|
|
tex_name::UTF8String
|
|
|
|
long_name::UTF8String
|
|
|
|
end
|
|
|
|
|
|
|
|
immutable ExoDet <: Atom
|
|
|
|
name::UTF8String
|
|
|
|
tex_name::UTF8String
|
|
|
|
long_name::UTF8String
|
|
|
|
end
|
|
|
|
|
|
|
|
immutable Param <: Atom
|
|
|
|
name::UTF8String
|
|
|
|
tex_name::UTF8String
|
|
|
|
long_name::UTF8String
|
|
|
|
end
|
|
|
|
|
|
|
|
immutable AuxVars
|
|
|
|
endo_index::Int
|
|
|
|
var_type::Int
|
|
|
|
orig_index::Int
|
|
|
|
orig_lead_lag::Int
|
|
|
|
eq_nbr::Int
|
|
|
|
orig_expr::UTF8String
|
|
|
|
end
|
|
|
|
|
2015-07-24 12:33:28 +02:00
|
|
|
immutable DetShocks
|
|
|
|
exo_det::Int
|
|
|
|
exo_id::Int
|
|
|
|
multiplicative::Bool
|
|
|
|
periods::Array{Int,1}
|
|
|
|
value::Float64
|
|
|
|
end
|
|
|
|
|
2015-07-23 17:32:09 +02:00
|
|
|
type Model
|
|
|
|
fname::ASCIIString
|
|
|
|
dname::ASCIIString
|
2015-07-24 12:33:28 +02:00
|
|
|
dynare_version::ASCIIString
|
2015-07-23 17:32:09 +02:00
|
|
|
endo::Array{Endo,1}
|
|
|
|
exo::Array{Exo,1}
|
|
|
|
exo_det::Array{ExoDet,1}
|
|
|
|
param::Array{Param,1}
|
|
|
|
aux_vars::Array{AuxVars,1}
|
|
|
|
pred_vars::Array{Int,1}
|
|
|
|
obs_vars::Array{Int,1}
|
|
|
|
orig_endo_nbr::Int
|
|
|
|
orig_eq_nbr::Int
|
|
|
|
eq_nbr::Int
|
|
|
|
ramsey_eq_nbr::Int
|
2015-07-24 12:33:28 +02:00
|
|
|
det_shocks::Array{DetShocks,1}
|
2015-07-23 17:32:09 +02:00
|
|
|
nstatic::Int
|
|
|
|
nfwrd::Int
|
|
|
|
npred::Int
|
|
|
|
nboth::Int
|
|
|
|
nsfwrd::Int
|
|
|
|
nspred::Int
|
|
|
|
ndynamic::Int
|
|
|
|
maximum_lag::Int
|
|
|
|
maximum_lead::Int
|
|
|
|
maximum_endo_lag::Int
|
|
|
|
maximum_endo_lead::Int
|
|
|
|
maximum_exo_lag::Int
|
|
|
|
maximum_exo_lead::Int
|
|
|
|
lead_lag_incidence::Matrix{Int}
|
2015-07-24 11:35:23 +02:00
|
|
|
nnzderivatives::Vector{Int}
|
2015-07-23 17:32:09 +02:00
|
|
|
static_and_dynamic_models_differ::Bool
|
|
|
|
equations_tags::Array{ASCIIString,1}
|
|
|
|
exo_names_orig_ord::Array{Int, 1}
|
2015-07-24 11:35:23 +02:00
|
|
|
sigma_e::Matrix{Float64}
|
|
|
|
correlation_matrix::Matrix{Float64}
|
|
|
|
h::Matrix{Float64}
|
|
|
|
correlation_matrix_me::Matrix{Float64}
|
2015-07-23 17:32:09 +02:00
|
|
|
sigma_e_is_diagonal::Bool
|
|
|
|
params::Vector{Float64}
|
|
|
|
end
|
|
|
|
|
2015-07-24 11:35:23 +02:00
|
|
|
function model()
|
2015-07-23 17:32:09 +02:00
|
|
|
return Model("", # fname
|
|
|
|
"", # dname
|
2015-07-24 12:33:28 +02:00
|
|
|
"", # dynare_version
|
2015-07-23 17:32:09 +02:00
|
|
|
Array(Endo,0), # endo
|
|
|
|
Array(Exo,0), # exo
|
|
|
|
Array(ExoDet,0), # exo_det
|
|
|
|
Array(Param,0), # param
|
|
|
|
Array(AuxVars,0), # aux_vars
|
|
|
|
Array(Int,0), # pred_vars
|
|
|
|
Array(Int,0), # obs_vars
|
|
|
|
0, # orig_endo_nbr
|
|
|
|
0, # orig_eq_nbr
|
|
|
|
0, # eq_nbr
|
|
|
|
0, # ramsey_eq_nbr
|
2015-07-24 12:33:28 +02:00
|
|
|
Array(DetShocks,0), # det_shocks
|
2015-07-23 17:32:09 +02:00
|
|
|
0, # nstatic
|
|
|
|
0, # nfwrd
|
|
|
|
0, # npred
|
|
|
|
0, # nboth
|
|
|
|
0, # nsfwrd
|
|
|
|
0, # nspred
|
|
|
|
0, # ndynamic
|
|
|
|
0, # maximum_lag
|
|
|
|
0, # maximum_lead
|
|
|
|
0, # maximum_endo_lag
|
|
|
|
0, # maximum_endo_lead
|
|
|
|
0, # maximum_exo_lag
|
|
|
|
0, # maximum_exo_lead
|
|
|
|
Array(Int, 3, 0), # lead_lag_incidence
|
2015-07-24 11:35:23 +02:00
|
|
|
zeros(Int, 3), # nnzderivatives
|
2015-07-23 17:32:09 +02:00
|
|
|
false, # static_and_dynamic_models_differ
|
|
|
|
Array(ASCIIString,0), # equations_tags
|
|
|
|
Array(Int64,1), # exo_names_orig_ord
|
2015-07-24 12:33:28 +02:00
|
|
|
Array(Float64, 0, 0), # sigma_e (Cov matrix of the structural innovations)
|
|
|
|
Array(Float64, 0, 0), # correlation_matrix (Corr matrix of the structural innovations)
|
|
|
|
Array(Float64, 0, 0), # h (Cov matrix of the measurement errors)
|
|
|
|
Array(Float64, 0, 0), # correlation_matrix_me (Cov matrix of the measurement errors)
|
2015-07-23 17:32:09 +02:00
|
|
|
true, # sigma_e_is_diagonal
|
|
|
|
Array(Float64, 0) # params
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|