|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.omegahat.Simulation.MCMC.NotifyingMCMCObject
org.omegahat.Simulation.MCMC.BaseMarkovChain
sir.estimate.LadyBug
This class implements estimation of the parameters in a SIR epidemic. Four methods are supported:
Nested Class Summary |
Nested classes inherited from class org.omegahat.Simulation.MCMC.NotifyingMCMCObject |
org.omegahat.Simulation.MCMC.NotifyingMCMCObject.MyHandle |
Field Summary | |
protected Data |
data
New version - all data related variables are gathered in a Data object |
static boolean |
DEBUG
Debugging flag - gives extra printed info |
static boolean |
E0Fixed
Configuration settings |
static java.text.DecimalFormat |
form
For formatting of doubles to an output stream. |
static boolean |
gotI
Do we have acces to I time |
protected boolean |
metropolisBeta
Do we want the beta's to be updated using Metropolis sampling. |
protected boolean |
metropolisGamma
Do we want the gamma's to be updated using Metropolis, i.e. |
static Distributions |
prob
The Pseudo random generator for distributions |
Fields inherited from class org.omegahat.Simulation.MCMC.NotifyingMCMCObject |
listeners |
Constructor Summary | |
LadyBug(org.omegahat.Simulation.RandomGenerators.PRNG prng,
java.lang.String dataFile)
Constructor which calls all the necessary sub-routines, s.a. reading of data, registering of listeners and iteration of the MC. |
Method Summary | |
org.omegahat.Simulation.MCMC.MCMCState |
generate(org.omegahat.Simulation.MCMC.MCMCState state)
Generate the next state of the Markov Chain using Gibbs-within-Metropolis. |
static void |
main(java.lang.String[] argv)
Main function - start a LadyBug analyserer based on prompt arguments |
void |
MCMCEst(int noOfSamples,
int thinFactor,
int noOfBurnin,
java.lang.String logFileName)
MCMC Estimation method - generates noOfSamples*thinFactor + noOfBurnin samples and estimates beta and gamma based on recovery times alone. |
void |
MLEst()
Calculate parameters beta and gamma using ML estimation. |
protected void |
readDataFile(java.lang.String fileName)
Read information about the epidemic from the denoted files. |
Methods inherited from class org.omegahat.Simulation.MCMC.BaseMarkovChain |
getState, iterate, run, step |
Methods inherited from class org.omegahat.Simulation.MCMC.NotifyingMCMCObject |
notifyAll, registerListener, unregisterListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean DEBUG
public static boolean gotI
protected Data data
protected boolean metropolisBeta
protected boolean metropolisGamma
public static java.text.DecimalFormat form
public static Distributions prob
public static boolean E0Fixed
Constructor Detail |
public LadyBug(org.omegahat.Simulation.RandomGenerators.PRNG prng, java.lang.String dataFile)
prng
- The pseudo random number generatordataFile
- Name of the file containing recovery, inf and sero timesMethod Detail |
public org.omegahat.Simulation.MCMC.MCMCState generate(org.omegahat.Simulation.MCMC.MCMCState state)
state
- Current chain of the MC
EpiState
protected void readDataFile(java.lang.String fileName)
fileName
- The filename of the data file.public void MCMCEst(int noOfSamples, int thinFactor, int noOfBurnin, java.lang.String logFileName)
noOfSamples
- The size of the sample to generatenoOfBurnin
- Number of samples to use as burnin. Note: No thinning applied herethinFactor
- Thinning, e.g. take each 100th sample.logFileName
- Name of the log file to save the output.public void MLEst()
public static void main(java.lang.String[] argv) throws java.lang.Throwable
java.lang.Throwable
readDataFile(java.lang.String)
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |