Skip to content

Commit

Permalink
Create image of resource allocation transitions #2
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsheldon committed Apr 27, 2020
1 parent c817103 commit cf564c7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
Binary file added docs/ResourceAllocation.pdf
Binary file not shown.
31 changes: 31 additions & 0 deletions docs/ResourceAllocation.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
\documentclass{article}

% External references
\usepackage{pgf}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{IEEEtrantools}
\usepackage{mathrsfs}

% For the Markov chain diagrams
\usetikzlibrary{arrows,automata}

\title{Resource Allocation Models}
\author{Aaron Geoffrey Sheldon}
\date{\today}
\begin{document}
\pagenumbering{gobble}
\begin{tikzpicture}[->,thick,node distance=3cm]
\node[state] (RA) {RA};
\node[state] (RR) [below right of=RA] {RR};
\node[state] (RO) [above right of=RR] {RO};
\node[state] (RC) [below of=RR] {RC};
\path
(RA) edge [bend left] node [above] {$\displaystyle\int_0^\infty \gamma\beta_\text{hos} e^{\gamma\alpha_\text{hos} a} n_\text{I} da$} (RO)
(RR) edge [bend left] node [below] {$\beta_\text{ref}$} (RA)
(RO) edge [bend left] node [right] {$\displaystyle\int_0^\infty \left(\gamma\beta_\text{age} e^{\gamma\alpha_\text{age} a} + \gamma\beta_\text{dis} e^{-\gamma\alpha_\text{dis} a}\right) n_{H} da$} (RR)
(RR) edge (RC);
\end{tikzpicture}
\end{document}
6 changes: 3 additions & 3 deletions src/vonFoersterHazards.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@
"\\end{array}\n",
"$$\n",
"\n",
"The scattering rates are normalized to be either greater than one $\\hat{\\sigma} \\ge 1$ or less than one $\\hat{\\sigma} \\le 1$ for all ages and can be of any form such as logistic or Gompertz. The hazard rate matrix $H$ can be a constant, representing the endogenous self interaction within a single age cohort, such as with ageing. It is from the modest observation that we construct the updating function inside the main loop of our engine.\n",
"The scattering rates are normalized to be either greater than one $\\hat{\\sigma} \\ge 1$ or less than one $\\hat{\\sigma} \\le 1$ for all ages and can be of any form such as logistic or exponential. The hazard rate matrix $H$ can be a constant, representing the endogenous self interaction within a single age cohort, such as with ageing. It is from the modest observation that we construct the updating function inside the main loop of our engine.\n",
"\n",
"By accumulating all the endogenous self interactions into a single matrix we can exploit the symmetry in age-age scattering cross section to write the exogenous term as a single product so that to first order the terms in our minimal age dependent communicable disease model are:\n",
"\n",
Expand Down Expand Up @@ -793,8 +793,8 @@
" & - \\gamma\\beta_\\text{hos} e^{\\gamma\\alpha_\\text{hos} a} \\int_0^\\infty n_\\text{RA} da & 0 & 0 & 0 & 0 & \\\\\n",
" & \\gamma\\beta_\\text{hos} e^{\\gamma\\alpha_\\text{hos} a} \\int_0^\\infty n_\\text{RA} da & - \\gamma\\beta_\\text{age} e^{\\gamma\\alpha_\\text{age} a} - \\gamma\\beta_\\text{dis} e^{-\\gamma\\alpha_\\text{dis} a} & 0 & 0 & 0 & \\\\\n",
" & 0 & 0 & -\\int_0^\\infty \\gamma\\beta_\\text{hos} e^{\\gamma\\alpha_\\text{hos} a} n_\\text{I} da & 0 & \\beta_{ref} & \\\\\n",
" & 0 & 0 & \\int_0^\\infty \\gamma\\beta_\\text{hos} e^{\\gamma\\alpha_\\text{hos} a} n_\\text{I} da & - \\int_0^\\infty \\gamma\\beta_\\text{age} e^{\\gamma\\alpha_\\text{age} a} - \\gamma\\beta_\\text{dis} e^{-\\gamma\\alpha_\\text{dis} a} n_{H} da & 0 & \\\\\n",
" & 0 & 0 & 0 & \\int_0^\\infty \\gamma\\beta_\\text{age} e^{\\gamma\\alpha_\\text{age} a} - \\gamma\\beta_\\text{dis} e^{-\\gamma\\alpha_\\text{dis} a} n_{H} da & -\\beta_{ref} & \\\\\n",
" & 0 & 0 & \\int_0^\\infty \\gamma\\beta_\\text{hos} e^{\\gamma\\alpha_\\text{hos} a} n_\\text{I} da & - \\int_0^\\infty \\left( \\gamma\\beta_\\text{age} e^{\\gamma\\alpha_\\text{age} a} + \\gamma\\beta_\\text{dis} e^{-\\gamma\\alpha_\\text{dis} a} \\right) n_{H} da & 0 & \\\\\n",
" & 0 & 0 & 0 & \\int_0^\\infty \\left(\\gamma\\beta_\\text{age} e^{\\gamma\\alpha_\\text{age} a} + \\gamma\\beta_\\text{dis} e^{-\\gamma\\alpha_\\text{dis} a} \\right) n_{H} da & -\\beta_{ref} & \\\\\n",
" & & & & & & \\ddots\n",
"\\end{bmatrix}\n",
"$$\n",
Expand Down
2 changes: 1 addition & 1 deletion src/vonFoersterHazards.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct evolve{R<:population, S<:Real, T<:Real}
gestation::T
count::Int64
end
Base.eltype(::Type{evolve{S, T}}) = S
Base.eltype(::Type{evolve{R, S, T}}) = R
Base.length(E::evolve) = E.count
Base.size(E::evolve, d=1) = ((d==1) ? length(E) : 1)
function Base.iterate(E::evolve)
Expand Down

0 comments on commit cf564c7

Please sign in to comment.