Skip to content
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

plot.mob_out uses rounded sampling effort for plot-based rarefaction curve #184

Closed
dmcglinn opened this issue Jan 28, 2018 · 1 comment
Closed
Labels

Comments

@dmcglinn
Copy link
Member

The function plot.mob_out provides the plot-based rarefaction curve which is the individual rarefaction curve evaluated at # of plots * treatment specific density. Currently this sampling effort is rounded (from the script ./R/mobr.R):

get_sample_curves  = function(...){
    ...
    nplots = nrow(comm_level)
    level_dens = sum(comm_level) / nplots
    samp_effort = round((1:nplots) * level_dens)
    impl_S = rarefaction(comm_level, 'indiv', samp_effort)
    ...
}

The need to round the sampling effort is because of the binomial coefficient only takes integers; however, the formula for individual-based rarefaction can be reformulated using the gamma function which can handle non-integer values. We could use instead:

    impl_S = rarefaction(comm_level, 'indiv', samp_effort, dens_ratio = 1 + 1e-14)

This would harness the gamma formulated form but not rescale the curve any. @rueuntal what do you think - probably this isn't going to make a huge deal but it seems like it would be nice to get away from rounding the sampling effort since we have the code in place to do this anyways.

@rueuntal
Copy link
Contributor

Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants