|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sir.model.EpiState | +--sir.model.SEIRStateExp
This class is used to represent the state a SEIR model as mentioned in the
O'Neill and Becker article. I.e. we have
- fixed latency time (c),
- beta* X * Y for infection and
- gamm, distributed infection time, i.e. f I\sim \Gamma(\gamma,\delta)
Note: Nothing about regimes included anymore.
Copyright: Copyright (c) 2002
Field Summary | |
double |
beta
Infection pressure aka. transmission parameter |
double |
c
Length of the latency period - this value does not really change |
double |
delta
Parameters of the gamma distribution |
static int |
deltaaccept
Delta acceptance rate |
Event[] |
E
All the exposed states |
double |
gamma
Parameters of the gamma distribution |
Fields inherited from class sir.model.EpiState |
betaNaccept, betaaccept, data, deviance, gammaaccept, I, Iaccept, loglik, nogen, prob, runs |
Constructor Summary | |
SEIRStateExp()
Constructor - necessary to allocate an array for I |
Method Summary | |
double |
f_to_minimize(double[] theta)
In case the object is given to a numerical minimizer, this is the function to minimize. |
EpiState |
generateNext()
Generate method for MCMC chain Modifcation happen on the instance itself to keep things simple. |
protected void |
genXYFuncs()
Generate X, Y, XY, and time by sorting appropriate events. |
void |
gradient(double[] x,
double[] g)
Gradient function, in case one wants to do numeric optimization of the likelihood. |
void |
hessian(double[] x,
double[][] h)
Hessian function, in case one wants to do numeric optimization of the likelihood. |
protected int |
ISize(Unit u,
int r)
Deduce number of 'I' events within unit and regime time contributing to the likelihood. |
double |
loglik()
Abstract method to calculate the loglikelihood of the state. |
double |
loglik2()
|
void |
ML()
|
EpiState |
sampleState()
Make a valid instance of the parameters to start the MCMC chain with. |
java.lang.String |
toHeaderParams()
Hook function to get header of logfile right. |
java.lang.String |
toStringParams()
Hook function called by toString. |
void |
updateBeta()
Gibbs updating of beta - we know the full conditional (see paper) |
void |
updateDelta()
Gibbs updating of delta - we know the full conditional (see paper) |
void |
updateGamma()
Update gamma using Metropolis Hastings. |
void |
updateI()
Update I using Metropolis Hastings. |
Methods inherited from class sir.model.EpiState |
acceptProposal, analLog, isIValid, ISize, setData, setProb, tauSize, toHeader, toString, toStringEvents, Yintegrate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public double c
public double beta
public double gamma
public double delta
public static int deltaaccept
public Event[] E
Constructor Detail |
public SEIRStateExp()
Method Detail |
public java.lang.String toHeaderParams()
toHeaderParams
in class EpiState
public java.lang.String toStringParams()
toStringParams
in class EpiState
protected int ISize(Unit u, int r)
ISize
in class EpiState
u
- The unitr
- The regime
public double loglik()
loglik
in class EpiState
public double loglik2()
public EpiState sampleState()
sampleState
in class EpiState
public void updateBeta()
public void updateDelta()
public void updateGamma()
public void updateI()
public EpiState generateNext()
generateNext
in class EpiState
public double f_to_minimize(double[] theta)
f_to_minimize
in interface Uncmin_methods
theta
- The parameter vector(remember Fortran indexing of arrayx (starting at 1))public void gradient(double[] x, double[] g)
gradient
in interface Uncmin_methods
x
- The parameter (remember Fortran indexing of arrayx (starting at 1))g
- The computed gradient.public void hessian(double[] x, double[][] h)
hessian
in interface Uncmin_methods
x
- The parameter (remember indexing of arrayx (starting at 1))protected void genXYFuncs()
genXYFuncs
in class EpiState
public void ML()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |