Skip to content
Back to formatted view

Raw Message

Message-ID: <57A92EB3.90506@gmail.com>
Date: 2016-08-09T01:15:31Z
From: Felipe
Subject: [OGRUG] Likelihood Ratio Test

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