[OGRUG] Likelihood Ratio Test

Felipe felipe.e.barletta at gmail.com
Tue Aug 9 03:15:31 CEST 2016


Hi dear R users!

I have a dubt about how to calculate the Likelihood Ratio Test:

I have below a density function:


##### Density Gompertz
dG <- function(x,a,b, log=FALSE){
d2 <- numeric(length(x))
d2 <- b*exp(a*x)*exp(-b/a*(exp(a*x) - 1))
dens <- if(log) log(d2) else d2
return (dens)
}

#### log-likelihood
ldG <- function(par, x)
{
sum( dG(x, a = par[1], b = par[2], log = TRUE))
}

emv.dG <- optim(par = c(.15, .01), fn = ldG, x = d1, hessian=TRUE
,control=list("fnscale"=-1))

emv.dG$value # likelihood

How do I calculate the Likelihood Ratio Test without a some package.
LRT = -2*(emv.dG$value - ?????)

-- 
Atenciosamente
Felipe E. Barletta Mendes
Estatístico(UFPR) - Conre3 9766-A
Mestrando em Bioestatística(UEM)
+55 (41)-92077191
+55 (41)-33287216



More information about the R-UG-Ottawa mailing list