|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsir.model.EpiState
sir.model.SEIRState
sir.model.SEIRwDState
Subclass implementing all functionality for an multivariate SEIRwD model. Extra functions for handling diagnostic events is added. Most is done using hook functions. However, the ML function is coded pretty much from scratch.
Field Summary | |
Event[] |
D
All seroconversion events |
double |
deltaD
Parameters of the gamma distributed seroconversion time |
int |
deltaD_
Indices in param array |
double |
gammaD
Parameters of the gamma distributed seroconversion time |
int |
gammaD_
Indices in param array |
Fields inherited from class sir.model.SEIRState |
deltaE, deltaE_, deltaI, deltaI_, E, Eaccept, expTransformParams, firstEventInUnits, gammaE, gammaE_, gammaI, gammaI_, justDiagnostic, lastEventInUnits, MeanVarianceParameters, useOrigins |
Fields inherited from class sir.model.EpiState |
accept, beta, beta_, betaN, betaN_, data, eta, I, loglik, modelParamNames, nogen, noOfModelParams, prob, R, runs, theta |
Constructor Summary | |
SEIRwDState()
Constructor - new necessary structures |
Method Summary | |
protected void |
addExtraEventsHook(int baseNoOfEvents)
Hook function to add additional events to the events array. |
void |
array2Params(double[] theta,
boolean expTransformParams)
Helper function, given an array of size noOfModelParams assign the values of this vector to the correct names. |
java.lang.Object |
clone()
Clone. |
protected int |
extraNoOfEventsHook()
Hook function returning how many additional events are put into the events array by subclasses etc. |
void |
gammaDelta2MeanVar()
The reverse of @see meanVar2GammaDelta, i.e. y=r(x) |
boolean |
isValidHook()
Hook function to check for a valid state. |
protected double |
loglikAddIndividualHook(int i)
Hook function for adding additional events to the loglikelihood. |
void |
meanVar2GammaDelta()
Transform from mean,variance to gammaX,deltaX for all parameters, where this applies. |
void |
MLParamsSetup(double[] theta0,
double[] typicalParamSize)
Hook function to be called when initializing the theta0 and typicalParamSize initialization in the ML method. |
void |
MLProfiles()
Create Profile Plots of LogLikelihood around the max |
double[] |
params2Array()
Helper functions to put all parameters in an array. |
protected void |
sampleStateEventsHook(int i,
boolean sampleCensored)
Use hook function to new individual's diagnostic event in case of censoring. |
protected void |
sampleStateParamsHook()
Initializing gammaD and deltaD is done using this hook function. |
java.lang.String |
toHeaderHook()
Hook function for header writing |
java.lang.String |
toStringDiagnostic()
Function to display how parameters relate to data. |
java.lang.String |
toStringEvents2()
This version shows only time of exposure and the length of the infectious time |
java.lang.String |
toStringEvents3()
Show all stats |
java.lang.String |
toStringHook()
Hook function calling the super before adding SEIRwD specifc things |
void |
updateD()
Method to update the D. |
void |
updateDeltaD()
Gibbs updating of deltaD - we know the full conditional (see paper) |
void |
updateE()
Update E using full conditionals. |
void |
updateEPropagate()
Update E using full conditionals. |
void |
updateGammaD()
Update gammaD using Metropolis Hastings. |
void |
updateHook(boolean justTheta)
Hook method to update additional parameters using MCMC, i.e. deltaD and gammaD |
Methods inherited from class sir.model.SEIRState |
betaHaz, betaHazAll, betaSurvLn, Eloc, Enbr, f_to_minimize, f_to_minimizeHook, generateNext, genXYFuncs, gradient, hessian, lastEventInit, loglik, loglikGammaDelta, ML, MLParamsPrintHook, periodsEV, sampleOrigins, sampleState, showStats, toStringLong, updateBeta, updateBetaN, updateDeltaE, updateDeltaI, updateGammaE, updateGammaI, updateI, updateMetroHastings, updateO, updateR |
Methods inherited from class sir.model.EpiState |
acceptProposal, analLog, fromString, generateNext, isIValid, setData, setProb, showStats, toHeader, toString, toStringEvents, Yintegrate |
Methods inherited from class java.lang.Object |
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 double gammaD
public double deltaD
public int gammaD_
public int deltaD_
public Event[] D
Constructor Detail |
public SEIRwDState()
Method Detail |
public java.lang.Object clone()
public void meanVar2GammaDelta()
gammaDelta2MeanVar
public void gammaDelta2MeanVar()
protected int extraNoOfEventsHook()
extraNoOfEventsHook
in class SEIRState
protected void addExtraEventsHook(int baseNoOfEvents)
addExtraEventsHook
in class SEIRState
baseNoOfEvents
- Number of E,I,R events in SEIRState class.
protected double loglikAddIndividualHook(int i)
loglikAddIndividualHook
in class SEIRState
i
- Number of the individual.
public void MLParamsSetup(double[] theta0, double[] typicalParamSize)
MLParamsSetup
in class SEIRState
theta0
- Array of theta0's, i.e. the start valuestypicalParamSize
- Typical sizepublic void MLProfiles()
MLProfiles
in class SEIRState
public java.lang.String toStringDiagnostic()
toStringDiagnostic
in class SEIRState
public void array2Params(double[] theta, boolean expTransformParams)
array2Params
in class SEIRState
theta
- - A vector of length noOfModelParams containing the values to assignexpTransformParams
- - When using the minimizer it is a good idea to operate with
log(param) value instead to avoid negative values.public double[] params2Array()
params2Array
in class SEIRState
public java.lang.String toStringEvents2()
public java.lang.String toStringEvents3()
public boolean isValidHook()
isValidHook
in class SEIRState
public java.lang.String toHeaderHook()
toHeaderHook
in class SEIRState
public java.lang.String toStringHook()
toStringHook
in class SEIRState
protected void sampleStateParamsHook()
sampleStateParamsHook
in class SEIRState
protected void sampleStateEventsHook(int i, boolean sampleCensored)
sampleStateEventsHook
in class SEIRState
i
- Number of the individual we are newing events for.public void updateGammaD()
public void updateDeltaD()
public void updateE()
updateE
in class SEIRState
public void updateEPropagate()
public void updateD()
public void updateHook(boolean justTheta)
updateHook
in class SEIRState
justTheta
- Just update theta no missing events.
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |