Description Usage Arguments Value Examples
View source: R/em_mcem_logll.R
Likelihood Estimation.
1 | Logll(tl, freq, theta)
|
tl |
Lower end of the intervals. |
freq |
Frequency on each interval. |
theta |
The arguments including mu and sigma. |
Return the result of the log likelihood for the mean (mu) and sigma (standard deviation) estimates.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(stats)
simdataaaa <- em.univ::univ_simul(ncol_matrix=1,
n=50,
nclass = 10,
mean = 68,
sd = 1.80,
fr_breaks=c(62,64,66,68,70,72,74,76,78))
tl <- simdataaaa$simul_data[,1,1]
freq <- simdataaaa$simul_data[,3,1]
res <- stats::optim(c((67/2),(1/2)),fn=Logll,tl=tl,freq=freq,
method="L-BFGS-B",lower=c(0.02,0.2),upper=c(180,2))
estimate<- res$par
mu_estimate<- base::round(res$par[1]/res$par[2],4)
sigma_estimate<- base::round(1/res$par[2],4)
sigma_squared_estimate = sigma_estimate^2
mu_estimate
sigma_squared_estimate
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.