Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecating functions #167

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/algos/simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ function response(model::AbstractModel, dr::AbstractDecisionRule,

response(model, dr; s0=s0, e1=e1, T=T)
end
@deprecate response(model::AbstractModel, dr::AbstractDecisionRule,s0::AbstractVector, e1::AbstractVector; T::Int=40) response(model, dr; s0=s0, e1=e1, T=T)

function response(model::AbstractModel, dr::AbstractDecisionRule,
e1::AbstractVector; T::Int=40)
Expand Down
11 changes: 9 additions & 2 deletions src/numeric/processes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ end
function simulate(mvn::MvNormal, N::Integer, T::Int, e0::Vector{Float64}; stochastic::Bool=true)
simulate(mvn, e0; N=N, T=T, stochastic=stochastic)
end
@deprecate simulate(mvn::MvNormal, N::Integer, T::Int, e0::Vector{Float64}; stochastic::Bool=true) simulate(mvn, e0; N=N, T=T, stochastic=stochastic)


function simulate(mvn::MvNormal; N::Integer, T::Int, stochastic::Bool=true)
simulate(mvn, mvn.mu; N=N, T=T, stochastic=stochastic)
Expand All @@ -152,6 +154,7 @@ end
function simulate(mvn::MvNormal, N::Integer, T::Int; stochastic::Bool=true)
simulate(mvn, N, T, mvn.mu; stochastic=stochastic)
end
@deprecate simulate(mvn::MvNormal, N::Integer, T::Int; stochastic::Bool=true) simulate(mvn; N=N, T=T, stochastic=stochastic)

function response(mvn::MvNormal, e1::AbstractVector; T::Int=40)
d = length(mvn.mu)
Expand All @@ -170,6 +173,7 @@ end
function simulate(process::DiscreteMarkovProcess, N::Int, T::Int, i0::Int)
simulate(process; N=N, T=T, i0=i0)
end
@deprecate simulate(process::DiscreteMarkovProcess, N::Int, T::Int, i0::Int) simulate(process; N=N, T=T, i0=i0)

function simulate(process::DiscreteMarkovProcess, m0::AbstractVector{Float64}; N::Int, T::Int)
# try to find index in process.values. IF we do, then simulate using
Expand All @@ -186,6 +190,7 @@ end
function simulate(process::DiscreteMarkovProcess, N::Int, T::Int, m0::AbstractVector{Float64})
simulate(process, m0; N=N, T=T)
end
@deprecate simulate(process::DiscreteMarkovProcess, N::Int, T::Int, m0::AbstractVector{Float64}) simulate(process, m0; N=N, T=T)

function simulate_values(process::DiscreteMarkovProcess; N::Int, T::Int, i0::Int)
inds = simulate(process; N=N, T=T, i0=i0)
Expand All @@ -200,6 +205,7 @@ end
function simulate_values(process::DiscreteMarkovProcess, N::Int, T::Int, i0::Int)
simulate_values(process; N=N, T=T, i0=i0)
end
@deprecate simulate_values(process::DiscreteMarkovProcess, N::Int, T::Int, i0::Int) simulate_values(process; N=N, T=T, i0=i0)

# VAR 1

Expand Down Expand Up @@ -336,6 +342,7 @@ function simulate(var::VAR1, N::Int, T::Int, x0::Vector{Float64};

simulate(var, x0; N=N, T=T, stochastic=stochastic, irf=irf, e0=e0)
end
@deprecate simulate(var::VAR1, N::Int, T::Int, x0::Vector{Float64}; stochastic::Bool=true, irf::Bool=false, e0::Vector{Float64}=zeros(0)) simulate(var, x0; N=N, T=T, stochastic=stochastic, irf=irf, e0=e0)

function simulate(var::VAR1; N::Int, T::Int, kwargs...)
return simulate(var, var.mu; N=N, T=T, kwargs...)
Expand All @@ -344,9 +351,9 @@ end
function simulate(var::VAR1, N::Int, T::Int; kwargs...)
return simulate(var; N=N, T=T, kwargs...)
end
@deprecate simulate(var::VAR1, N::Int, T::Int; kwargs...) simulate(var; N=N, T=T, kwargs...)

function response(var::VAR1, x0::AbstractVector,
e1::AbstractVector; T::Int=40)
function response(var::VAR1, x0::AbstractVector, e1::AbstractVector; T::Int=40)
simulate(var, x0; N=1, T=T, stochastic=false, irf=true, e0=e1)[1, :, :]
end

Expand Down