MicEco
MicEco copied to clipboard
Suprising gRsqr calculation in neutral.fit
Hello,
I am using the neutral.fit function and I was surprised by the gRsqr results I was getting: they were not sustaining the visual impression I had of the fit. I tried to calculate the generalized R squared using the formula provided in Burns et al. (2015, ISME J 10(3):655-664) and I got very different results that fitted what I expected.
In Burns and al., they calculate R2 with: R2 = 1 - SSerr/SStotal
with SSerr the sum of squares of residuals and SStotal the total sum of squares
In neutral.fit, gRsqr is calculated with: R2 = 1 - exp(-as.numeric(logLik(m.mle))/length(p))
with p the number of observations and logLik(m.mle) the log likelihood of the model predicted by mle2
Do you have an insight on the difference between the two calculations?
Thanks,