|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsir.model.EpiState
The EpiState is an abstract base class implementing common features of the epidemic model. A class hierarchy with SEIRState and SEIRwDState as subclasses. The EpiState is an abstract base class implementing a couple of common features -- most functionality will be made in the subclasses.
Field Summary | |
int[] |
accept
Acceptance counts for all traditional parameters |
double |
beta
Infection pressure aka. transmission parameter |
int |
beta_
|
double |
betaN
Vaccination effect |
int |
betaN_
|
protected static Data |
data
Static link to the data. |
double |
eta
Neighbour effect |
Event[] |
I
Array of infection times, I1,... |
double |
loglik
LogLikelihood |
java.lang.String[] |
modelParamNames
The names of all model parameters to be used when printing them |
boolean |
nogen
Boolean telling whether the time wise structure has been created on this object (inits events array) |
int |
noOfModelParams
Number of model parameters, i.e. no of unknowns when we have full data |
protected static Distributions |
prob
Static link to a random number generator |
Event[] |
R
Array of recovery times, R1,... |
static int |
runs
Static stuff to keep track of progress |
double[] |
theta
Dual representation of params by array |
Constructor Summary | |
EpiState()
Constructor - initializes structures holding who is parameter and who is fixed among the recovery and infection events. |
Method Summary | |
protected boolean |
acceptProposal(double logfnew,
double logfold)
Based on acceptance probability we find out whether to accept a sample i.e. we accept it with probability min( f(x'|)pi(x') / f(x|)pi(x), 1) |
java.lang.String |
analLog(java.lang.String logFileName)
Method to present mean and variance of posterior for each variable contained in the logfile. |
void |
fromString(java.lang.String aLine)
Take a line from a logfile and assign the parameters. |
EpiState |
generateNext()
|
abstract EpiState |
generateNext(boolean justTheta)
Generate method for MCMC chain |
abstract void |
genXYFuncs()
Generate X, Y as functions of time by bookeeping of events |
boolean |
isIValid()
Verify whether I is valid wrt. tau, i.e. that the constraints are fulfilled |
boolean |
isValidHook()
Hook function to be used by subclasses |
abstract double |
loglik()
Abstract method to calculate the loglikelihood of the state |
abstract double[] |
params2Array()
Helper functions to put all parameters in an array. |
abstract EpiState |
sampleState(boolean sampleCensored)
Make a valid instance of the parameters, e.g. to start the MCMC chain with |
static void |
setData(Data theData)
Set reference to the data |
static void |
setProb(Distributions theProb)
|
java.lang.String |
showStats(java.lang.String logFile)
Show statistics once we are done. |
java.lang.String |
toHeader()
What to write to the header of the log |
java.lang.String |
toHeaderHook()
|
java.lang.String |
toString()
Debug/Information as usual. |
java.lang.String |
toStringEvents()
Show X(t) and Y(t) as functions |
java.lang.String |
toStringHook()
|
java.lang.String |
toStringLong()
Current State information is shown on screen in long format |
protected double |
Yintegrate(Unit u,
double tstop)
Calculate int_{i_0}^t Y_u(t) dt for a unit u and regime r. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface sir.optim.Uncmin_methods |
f_to_minimize, gradient, hessian |
Field Detail |
public Event[] I
public Event[] R
public int noOfModelParams
public java.lang.String[] modelParamNames
public double beta
public double eta
public double betaN
public double[] theta
public int beta_
public int betaN_
public double loglik
public boolean nogen
public static int runs
public int[] accept
protected static Data data
protected static Distributions prob
Constructor Detail |
public EpiState()
Method Detail |
public void fromString(java.lang.String aLine)
aLine
- A line from the logfile containing all the parameterspublic java.lang.String toStringHook()
public java.lang.String toString()
public java.lang.String toStringLong()
public java.lang.String toHeader()
public java.lang.String toHeaderHook()
public java.lang.String toStringEvents()
protected double Yintegrate(Unit u, double tstop)
u
- The unit to get Y(t) from.tstop
- Integrate \int_{i_0}^{t} Y(t) dt
public boolean isValidHook()
public boolean isIValid()
public abstract void genXYFuncs()
public abstract double loglik()
public abstract EpiState sampleState(boolean sampleCensored)
protected boolean acceptProposal(double logfnew, double logfold)
logfnew
- log( f(x'|...) * pi(x') ), i.e. numerator of acceptance fractionlogfold
- log( f(x'|...) * pi(x) ), i.e. denumerator of acceptance fraction
public static void setData(Data theData)
public static void setProb(Distributions theProb)
public abstract EpiState generateNext(boolean justTheta)
justTheta
- Boolean indicating whether to just update the beta,...,gamma_D variablespublic EpiState generateNext()
public abstract double[] params2Array()
public java.lang.String analLog(java.lang.String logFileName)
logFileName
- The name of the logfile to look in.
public java.lang.String showStats(java.lang.String logFile)
logFile
- Name of the logFile to analyze
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |