Skip to content

Commit

Permalink
Update documentation for solve function and add one for steady_state_K
Browse files Browse the repository at this point in the history
  • Loading branch information
joannakonieczny committed Jun 5, 2024
1 parent b01a8ad commit 949a9af
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/RamseyGrowthModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ function shooting(model::GrowthModel, T::Integer, K₀::Real, C₀::Real)::DataF
allocation
end

"""
Returns steady state capital K, to which capital Kₜ converges for large values of T.
```julia
steady_state_K(model::GrowthModel)
```
# Arguments
* `model` - previously defined growth model
This value is mostly useful for plotting purposes and as a starting point of a simulation.
"""
function steady_state_K(model::GrowthModel)::Real
f′(k::Real) = ForwardDiff.derivative(model.f, k)
find_zero(x -> f′(x) - 1 / model.β + 1 - model.δ, (0, Inf64))
Expand All @@ -92,7 +105,7 @@ end
Returns the best possible capital and consumption allocation (as a DataFrame).
```julia
solve(model::GrowthModel, T::Integer, K₀::Real; kwargs...)
solve(model::GrowthModel, T::Union{Integer,typeof(Inf)}, K₀::Real; kwargs...)
```
# Arguments
Expand Down

0 comments on commit 949a9af

Please sign in to comment.