|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sir.estimate.SIRestimate.SIRState
Class corresponds to state of the Markov Chain in the simple SIR example. It consists of beta, gamma, I1, \mathbf{I}. The two latter are stored into the same I array as I[0] and I[1]...I[?], respectively. Added: Implements Uncmin_methods which will contain a wrapper for the optimization class.
Field Summary | |
double |
deviance
Deviance part |
double |
loglik
LogLikelihood |
Constructor Summary | |
SIRestimate.SIRState()
Constructor - necessary to allocate an array for I |
Method Summary | |
void |
add(SIRestimate.SIRState s,
double noOfSamples)
Add values for posterior mean calculations |
double |
f_to_minimize(double[] theta)
In case the object is given to a numerical minimizer, this is the function to minimize. |
protected void |
genXYZFromLambdaI()
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 |
logflambdaI()
Corrected spatial edition, calculating \int_{I_0}^T \sum_{u\in U} \lambda_\all^u(t) |
protected int |
tauSize(Unit u,
int r)
Deduce number of 'R' events within unit and regime time contributing to the likelihood. |
java.lang.String |
toString()
Debug/Information as usual |
void |
translateTheta2Beta(double[] theta)
Function to transfer beta vector from one long array to our 3D array This is used in the minimizing stuff. |
void |
writeRFile()
To R-compatible file, i.e. write a .txt file containing the following columns t, X_11, Y_11, ..., X_nn, Y_nn, eventype. |
protected double |
XYintegrate(Unit u,
int r)
Calculate int_{S[i-1]},S[i]} X(t) Y(t) for a regime i. |
protected double |
Yintegrate(Unit u,
int r)
Calculate int_{S[i-1]},S[i]} 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 |
Field Detail |
public double loglik
public double deviance
Constructor Detail |
public SIRestimate.SIRState()
Method Detail |
public void translateTheta2Beta(double[] theta)
double[]
- theta The parameter vector, for compatability with Fortran we start at index 1. First spaces are beta, rest is betaNpublic double f_to_minimize(double[] theta)
f_to_minimize
in interface Uncmin_methods
x
- The parameter (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))g
- The computed gradient.public void writeRFile()
public java.lang.String toString()
toString
in class java.lang.Object
public void add(SIRestimate.SIRState s, double noOfSamples)
protected double Yintegrate(Unit u, int r)
u
- The unit to get Y(t) from.r
- The regime defining the time limits. I.e. all points with that number.protected double XYintegrate(Unit u, int r)
u
- Unit to take X,Y values in. This only works as long as there is no interaction.r
- The regime defining the time limits. I.e. all points with that number.protected int ISize(Unit u, int r)
u
- The unitr
- The regimeprotected int tauSize(Unit u, int r)
u
- The unitr
- The regimeprotected void genXYZFromLambdaI()
public double logflambdaI()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |