Description Usage Arguments Value References See Also Examples
This mgpsEM
function finds hyperparameter estimates by implementing the Expectation-Maximization (EM) algorithm.nlminb
function is used to maximize the loglikelihood function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
alpha1 |
initial shape parameter guess of the first gamma distribution |
beta1 |
initial rate parameter guess of the first gamma distribution |
alpha2 |
initial shape parameter guess of the second gamma distribution |
beta2 |
initial rate parameter guess of the second gamma distribution |
pi |
initial mixing proportion guess of the two gamma distributions |
N |
vector of Nij values |
E |
vector of Eij values |
weight |
set weight = rep(1, length(N)) if N and E are not squashed data, or input the weight vector corresponding to the squashed Nij vector. |
iteration |
number of EM algorithm iterations to run |
Loglik |
whether to return the loglikelihood of each iteration or not (TRUE or FALSE) |
zeroes |
A logical scalar specifying if zero counts should be included. |
N_star |
the minimum Nij count size to be used for hyperparameter estimation. If zeroes are included in Nij vector, please set N_star = NULL |
a list including the following:
theta_EM
Estimate of hyperparameters for each EM iteration
llh
logliklihood for each EM iteration (optional)
DuMouchel W (1999). "Bayesian Data Mining in Large Frequency Tables, With an Application to the FDA Spontaneous Reporting System." The American Statistician, 53(3), 177-190.
openEBGM, nlminb
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.