Skip to content

Commit

Permalink
Commented out some example code, see issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
andrechalom committed Apr 20, 2015
1 parent 10d6339 commit da4bf79
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
9 changes: 6 additions & 3 deletions man/fitsad.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,12 @@ AICtab(moths.ln, moths.pln, moths.ls, moths.mzsm, weights=TRUE)

## Biomass as abundance variable
data(ARN82.eB.apr77) #benthonic marine animals
AR.ln <- fitsad(ARN82.eB.apr77, sad="lnorm", dec.places=2)
AR.g <- fitsad(ARN82.eB.apr77, sad="gamma", dec.places=2)
AR.wb <- fitsad(ARN82.eB.apr77, sad="weibull", dec.places=2)
#AR.ln <- fitsad(ARN82.eB.apr77, sad="lnorm", dec.places=2)
AR.ln <- fitsad(ARN82.eB.apr77, sad="lnorm")
#AR.g <- fitsad(ARN82.eB.apr77, sad="gamma", dec.places=2)
AR.g <- fitsad(ARN82.eB.apr77, sad="gamma")
#AR.wb <- fitsad(ARN82.eB.apr77, sad="weibull", dec.places=2)
AR.wb <- fitsad(ARN82.eB.apr77, sad="weibull")
plot(octav(ARN82.eB.apr77))
lines(octavpred(AR.ln))
lines(octavpred(AR.g), col="red")
Expand Down
30 changes: 15 additions & 15 deletions man/trueLL.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,23 @@ logLik(fitdistr(x, "lognormal"))
## Which is the sum of log of densities
sum( dlnorm(x, meanlog=mean(log(x)), sdlog=sd(log(x)), log=TRUE) )
## Correct log-likelihood
<<<<<<< HEAD
trueLL(x, "lnorm", coef=list(meanlog=mean(log(x)), sdlog=sd(log(x))),
dec.places=1, )
#<<<<<<< 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
#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
}

\keyword{methods}
Expand Down

0 comments on commit da4bf79

Please sign in to comment.