Closed csgillespie closed 7 years ago
Not sure I follow - I cannot find rgambin
on your fork, so I'm not quite sure what it returns?
If x
is a vector of abundances, the current function should take it:
> x = c(2,2,5,4,6,8,6,123,3,4554)
> fitGambin(x)
GamBin distribution fit
Data: x
Coefficients:
Alpha MaxOctave
1.59 12.00
The rgambin
function simulates values from the gambin
distribution (https://github.com/csgillespie/gambin/blob/master/R/dgambin.R#L63) - it uses a simple look-up method.
In fitGambin
, the input isn't values from the gambin distribution, it's abundances. The fitGambin
detects that x
is a vector and calls create_octaves
(https://github.com/csgillespie/gambin/blob/master/R/fit_gambin.R#L36)
My point is that this seems odd. It would be cleaner to separate your particular use case (ecology) with the general statistical distribution.
I see what you mean, but I actually think of the 'octaves' as an integral part of the gambin distribution. I think of the gambin distribution as a distribution over abundances rather than a distribution over octaves, though I realize that is slightly at odds with the name (because the distribution is gamma-binomial over octaves). Hm, maybe worth debating this with Karl Ugland who designed the distribution.
I think Tom'll ask Ugland - either way, you've given us something to think about here.
So Karl replied. He said, GAMBIN is not attached to octaves. The reason octaves were attached to GAMBIN was that I developed the method in cooperation with community ecologists who preferred to work with octaves in the Species-Abundance analysis. Gambin will work for any histogram.
But he said he was happy with what ever we decided to do
Huh, so it is the octaves/histogram that is gambin distributed, not the abundances? It is like he does not really answer that, isn’t it?
He also said he agreed with your opinion Michael, so I'm not sure?
oh did he (so confused)? Can you forward the mail? —
Michael Krabbe Borregaard, MSc, PhD Assistant Professor (TT), Center for Macroecology, Evolution & Climate Natural History Museum of Denmark, University of Copenhagen Universitetsparken 15, DK-2100 Copenhagen
Subject Editor, Ecography Associate Editor, Global Ecology and Biogeography
Featured paper: Oceanic island biogeography through the lens of the general dynamic model: assessment and prospecthttp://onlinelibrary.wiley.com/doi/10.1111/brv.12256/full, Biological Reviews (2016). An Anthropocene map of genetic diversityhttp://science.sciencemag.org/content/353/6307/1532, Science (2016)
Fra: txm676 notifications@github.com<mailto:notifications@github.com> Svar til: mkborregaard/gambin reply@reply.github.com<mailto:reply@reply.github.com> Dato: torsdag den 22. december 2016 kl. 12.17 Til: mkborregaard/gambin gambin@noreply.github.com<mailto:gambin@noreply.github.com> Cc: Michael Krabbe Borregaard mkborregaard@snm.ku.dk<mailto:mkborregaard@snm.ku.dk>, Comment comment@noreply.github.com<mailto:comment@noreply.github.com> Emne: Re: [mkborregaard/gambin] Odd interface to fitGambin (#4)
He also said he agreed with your opinion Michael, so I'm not sure?
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/mkborregaard/gambin/issues/4#issuecomment-268779485, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AICg6oWVFYAQeBZSecY6t-iLUUANvkZjks5rKlxggaJpZM4LQPeo.
The fitGambin has (I think) a strange interface. It becomes obvious(?) now there is a function for generating random numbers. To generate random numbers from the gambin distribution
To estimate
alpha
we now use the clunkyTypically
fit*
functions would takex
as an input.Proposal:
fitGambin
fit_gambin
. Ifx
is a vector assume that the numbers come from agambin
distribution. Ifx
is a data.frame, do as is currently done.