Skip to content

Commit

Permalink
Small refactor of engine #5. Typos in #4
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsheldon committed Apr 22, 2020
1 parent c1d7b8c commit ed4b667
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
von Foerster Hazards
====================

In this project I implement a model of age dependent communicable diseases using a mysterious and magical alchemy of von Foerster dynamics, Gompertz processes - biologically endogenous ageing modeled by Poisson processes subordinated by integrated geometric Brownian motion, Makeham processes - biologically exogenous casualties of serialized interactions, accelerated failure time models, and phase type distributions, while incanting the theory of stochastic processes and their infinitesimal generators: the all mighty hazard rate.
In this project I implement a model of age dependent communicable diseases using a mysterious and magical alchemy of von Foerster dynamics, Gompertz processes - biologically endogenous ageing modeled by Poisson processes subordinated by integrated geometric Brownian motion, Makeham processes - biologically exogenous casualties of serialized interactions, accelerated failure time models, phase type distributions, and the Lie algebra of hazard rates, while incanting the theory of stochastic processes.

Citing
------
Expand Down
Binary file modified docs/GompertzProcesses.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/GompertzProcesses.tex
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@

\section{Hazard Rate}
Consider the first passage stopping time $T_1$ of the Gompertz process $G_t$, its
cumulative distribution is the characteristic functions of $Y_t$:
cumulative distribution is the characteristic function of $Y_t$:
\begin{IEEEeqnarray}{rCl}
\operatorname{\mathbb{P}}\left[ T_1 \ge t\right]
& = &
Expand Down Expand Up @@ -327,7 +327,7 @@
& $h = \lambda$ &
$\displaystyle\left[\frac{\partial}{\partial\mu}\cdot + \frac{\partial}{\partial\sigma}\cdot\right]\left(f_{\mu, \sigma}\left( \lambda \operatorname{\mathbb{E}}\left[Y_t\right] \right)\right)$\\\\
$\sigma = 0$
& $h = \lambda \mu e^{\mu t}$ &
& $h = \lambda e^{\mu t}$ &
$\displaystyle\frac{\partial}{\partial\sigma} f_{\mu, \sigma}\left( \lambda \operatorname{\mathbb{E}}\left[Y_t\right] \right)$\\\\
\end{longtable}
\end{document}
2 changes: 1 addition & 1 deletion src/vonFoersterHazards.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@
"\\end{array}\n",
"$$\n",
"\n",
"Likewise, early in advancing the cutoff the logarithm will be constant. To determine $c_t$ we then simply need to read off the graph of the cumulative effectively available population $F\\left(c_t\\right)$ the point at which the following solution holds:\n",
"Likewise, $\\hat{\\omega}$ can be roughly estimated as the ratio of the entire population to those not currently infected. To determine $c_t$ we then simply need to read off the graph of the cumulative effectively available population $F\\left(c_t\\right)$ the point at which the following solution holds:\n",
"\n",
"$$\n",
"\\begin{array}{rcl}\n",
Expand Down
18 changes: 9 additions & 9 deletions src/vonFoersterHazards.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ function Base.iterate(E::evolve, step::Int64)
else

# One time computation of the extensize birth rate
b = birthrate(E.ages, E.population)
b = birthrate(E)

# One time computation of the extensive hazard rate
H = hazardrate(E.ages, E.population)
H = hazardrate(E)

# Curried transition function
t(a, n) = conservesum!(randomtruncate.(exp(-E.size * hazardrate(a, H)) * n), sum(n))
Expand All @@ -74,7 +74,7 @@ function Base.iterate(E::evolve, step::Int64)

# Youngest cohort is less than 1 year old, add births to youngest cohort
if E.ages[end] < 1.0 then
@inbounds E.population[end] = E.population[end] + b
E.population[end] = E.population[end] + b

# Youngest cohort is more than 1 year old, generate a new youngest cohort
else
Expand All @@ -86,20 +86,20 @@ function Base.iterate(E::evolve, step::Int64)
end

"""
birthrate(a, n)
birthrate(E)
Stub function to be overloaded in implementation. Compute the extensive
birth rate vector from the ages a and occupancy n of the population.
birth rate vector from the population E.
"""
function birthrate(a::AbstractVector{Float64}, n::AbstractVector{T})::T where T<:AbstractVector{Int64} end
function birthrate(E::evolve)::T where T<:AbstractVector{Int64} end

"""
hazardrate(a, n)
hazardrate(E)
Stub function to be overloaded in implementation. Compute the extensive
hazard rate matrix from the ages a and occupancy n of the population.
hazard rate matrix from the population E.
"""
function hazardrate(a::AbstractVector{Float64}, n::AbstractVector{T} where T<:AbstractVector{Int64})::AbstractMatrix{Float64} end
function hazardrate(E::evolve)::T where T<:AbstractMatrix{Float64} end

"""
hazardrate(a, H)
Expand Down

0 comments on commit ed4b667

Please sign in to comment.