weecology / macroecotools

Tools for Macroecological Analyses Using Python
Other
9 stars 13 forks source link

Attempt to generalize the AICc_weight function in macroecotools and improve documentation in macroeco_distributions #6

Closed embaldridge closed 10 years ago

embaldridge commented 10 years ago

Changes the AICc_weight function to output a table of raw AICcs, delta AICcs, and relative likelihoods (weights).

Adds a list of probability distribution functions and likelihoods to the beginning of the macroeco_distributions module.

ethanwhite commented 10 years ago

Thanks Elita! This is close, but I think it needs a little more work. I think that the loop should probably be something like this:

    relative_likelihoods = []
    for AICc in AICc_list:
        delta_AICc = AICc - AICc_min
        relative_likelihood = np.exp(-(delta_AICc)/2)
        relative_likelihoods.append(relative_likelihood)
    relative_likelihoods = np.array(relative_likelihoods)
    AICc_weights = relative_likelihoods / sum(relative_likelihoods)

In other words, the weights themselves are actually the relative likelihoods divided by the the sum of all of those likelihoods.

embaldridge commented 10 years ago

Better-ish?

embaldridge commented 10 years ago

Better-ish?

ethanwhite commented 10 years ago

This looks good to me.

@rueuntal - can you take a quick peak at this to make sure that my statistics are still up to snuff? Thanks.

embaldridge commented 10 years ago

Better-ish?

embaldridge commented 10 years ago

Better-ish?