-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird results with trueLL #5
Comments
I conservatively removed trueLL argument from fitting functions. It will be available in AIC methods, but not as default untill this issue is not solved. |
Not exactly related to this issue, but the man page of the trueLL function has a marker for a merge conflict: <<<<<<< HEAD
> trueLL(x, "lnorm", coef=list(meanlog=mean(log(x)), sdlog=sd(log(x))),
> dec.places=1, )
> Data in classes
> xoc <- octav(x)
> xc <- as.numeric(as.character(xoc$octave))
> xb <- 2^(c(min(xc)-1, xc))
> xh <- hist(x, breaks=xb, plot=FALSE)
> xll <- trueLL(x, dens="lnorm", breaks = xb, counts = xoc$Freq,
> coef = list(meanlog=mean(log(x)), sd=sd(log(x))))
> xp <- diff(plnorm(xh$breaks, mean(log(x)), sd(log(x))))
> xll2 <- sum( rep(log(xp), xh$counts))
> all.equal(xll, xll2) # should be TRUE
> =======
> trueLL(x, "lnorm", coef=list(meanlog=mean(log(x)), sdlog=sd(log(x))), dec.places=1)
> >>>>>>> provisorio Also: the examples in fitsad.Rd are using the "dec.places" argument in the current version, I'm commenting them out in the development branch until dec.places is supported. |
Conflict solved and I removed the commented lines by now. |
Before implementing the method in AIC, we need to understand the weird result itself. |
The decision of where to cut the underlying distribution is very problematic. I don't see any theoretical reason to chose between three alternatives:
The first seems a bit more natural, but this choice is perfectly arbitrary. However, the impacts of chosing each alternative are huge: > l <- fitlnorm(moths, trunc=0.5)
> trueLL(moths, "lnorm", as.list(coef(l)), trunc=0.5) # alternative 1
[1] -1085.468
> trueLL(moths+0.5, "lnorm", as.list(coef(l)), trunc=0.5) # alternative 2
[1] -1102.392
> trueLL(moths-0.5, "lnorm", as.list(coef(l)), trunc=0.5) # alternative 3
[1] -1095.544 In this light, I don't think it's advisable to use the |
I rewrote the code on In my opinion, what we should do is:
|
Agree that we need more theoretical ground to use trueLL. So I'd be rather more conservative and move trueLL + man page to a branch from dev and remove this issue from the milestone. |
So, trueLL should be kept just on a branch? For the released package, should we remove trueLL methods? |
Yes. Thinking that a package encapsulates an analytical workflow, I can't
|
I have updated the branch |
trueLL is supposed to provide a fair comparison between likelihoods of discrete and continuous distributions. For Fisher's moth data data however, I got a weird result with trueLL=TRUE: a truncated lognormal model has lower AIC than a Poisson-lognormal model, but diagnostic plots suggest that poilog fits better:
The model selection table:
and the plot:
The text was updated successfully, but these errors were encountered: