Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
albop committed Sep 13, 2023
1 parent 0ffa98f commit 866b749
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/algos/simul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ end

### transition function

function τ(dmodel::Dolo.DYModel{M}, ss::T, a::SVector) where M<:Union{Dolo.YModel{<:Dolo.VAR1},Dolo.YModel{<:Dolo.MarkovChain}} where T<:QP

# TODO We should differentiate here whether dproc has a markov chain or something else
function τ(dmodel::Dolo.DYModel{M}, ss::T, a::SVector) where M<:Union{Dolo.YModel{<:Dolo.VAR1},Dolo.YModel{<:Dolo.MarkovChain}} where T<:QP

(i,_) = ss.loc
s_ = ss.val
Expand All @@ -21,7 +22,9 @@ function τ(dmodel::Dolo.DYModel{M}, ss::T, a::SVector) where M<:Union{Dolo.YMod
P[i,j],
let
S_exo = Q[j]
S_endo = SVector(transition(dmodel.model, s_, a, Q[j])...)
S_endo = SVector(
transition(dmodel.model, s_, a, Q[j])...
)
S = SVector(S_exo..., S_endo...)
QP((j,S_endo),S)
# (loc=(j,S_endo),val=S)
Expand Down
7 changes: 4 additions & 3 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ function calibrated(model::YModel, group)
elseif group==:exogenous
vars = variables(model.exogenous)
elseif group==:parameters
return SVector(
(v for (k,v) in model.calibration if
!(k in union(variables(model.states), variables(model.controls), variables(model.exogenous)))
vars = union(variables(model.states), variables(model.controls), variables(model.exogenous))
return SVector(
(v for (k,v) in pairs(model.calibration) if
!(k in vars)
)...
)
else
Expand Down

0 comments on commit 866b749

Please sign in to comment.