EM.BD.SC: Expectation-Maximization on Linear Birth Death (_S_pecial...

Description Usage Arguments Details Value Author(s) See Also

View source: R/BD_EM.R


EM Algorithm for estimating rate parameters of a linear Birth-Death process, in which the data is the state at discrete time points


EM.BD.SC(dat, initParamMat, tol = 1e-04, M = 30, beta.immig,  dr =
1e-07, n.fft = 1024, r=4, prec.tol=1e-12, prec.fail.stop=TRUE,
verbose=1, verbFile=NULL)
EM.BD.SC.1(dat,init.params, tol = 0.001, M = 30, beta.immig,  dr =
1e-07, n.fft = 1024, r=4, prec.tol=1e-12, prec.fail.stop=TRUE,
verbose=1, verbFile=NULL)



nx2 matrix. Each row is an initial parameter setting. n is the number of times to run the full EM algorithm. On the nth time the initial "guess" of the lambda is initParamMat[n,1] and of mu it's initParamMat[n,2]. Used to automate starting at dispersed values to ensure global maximum. Frequently n is one.


Vector of length two, first number is the first guess for lambda, second is the guess for mu. This is like a single row from initParamMat.


Maximum number of iterations for (each) EM algorithm to run through. EM algorithm stops at Mth iteration.


Tolerance for EM algorithm; when two iterations are within tol of each other the algorithm ends. Algorithm also ends after M iterations have been reached. (note: One can debate whether 'tol' should refer to the estimates or to the actual likelihood. here it is the estimates, though).


Immigration rate is constrained to be a multiple of the birth rate. immigrationrate = beta.immig * lambda where lambda is birth rate.


Number of terms to use in the fast fourier transform or the riemann integration when using the generating functions to compute probabilities or joint expectations for the birth-death process. See the add.cond.mean.many, etc, functions.


Partially observed chain. Either of class "CTMC_PO_many" for several independent histories, of class "CTMC_PO_1" for one history, or a list with components $times and $states where dat$states[i] is the state observed at time dat$times[i] (ie, if it is a list then it is analogous to "CTMC_PO_1").


Parameter for numerical differentiation


Parameter for numerical differentiation; see numDeriv package documentation.


"Precision tolerance"; to compute conditional means, first the joint means are computed and then they are normalized by transition probabilities. The precision parameters govern the conditions under which the function will quit if these values are very small. If the joint-mean is smaller than prec.tol then the value of prec.fail.stop decides whether to stop or continue.


If true, then when joint-mean values are smaller than prec.tol the program stops; if false then it continues, usually printing a warning.


Chooses level of printing. Increasing from 0, which is no printing.


Character signifying the file to print to. If NULL just to standard output.


Assume we have a linear-birth-death process X_t with birth parameter lambda, death parameter mu, and immigration parameter beta*lambda (for some known, real beta). We observe the process at a finite set of times over a time interval [0,T]. Runs EM algorithm to do maximum likelihood.

EM.BD.SC will run the algorithm on multiple starting values and return the history for the best starting value. EM.BD.SC.1 only runs the algorithm for one starting value. Otherwise they are the same.


Returns a M+1x2 matrix, the nth row being the estimators at the nth iteration. The first column is for lambda (birth), the second for mu (death). If tol is reached before M iterations then many of the rows will be empty, but the M+1st always contains the estimators.


Charles Doss

See Also


DOBAD documentation built on May 2, 2019, 3:04 a.m.