figshare
Browse

sorry, we can't preview this file

wbl_LRT.m (6.3 kB)

Matlab code for a Weibull likelihood-ratio test

Download (0 kB)
software
posted on 2014-04-22, 10:57 authored by Philip E. HigueraPhilip E. Higuera

Matlab code for a Weibull likelihood-ratio test

The Matlab function wbl_LRT.m compares n distributions of data using a likelihood-ratio test, based on the maximum-likelihood values of a Weibull distribution fit to the input data. Details on the test are in Appendix B in Higuera et al. (2009), and details on how the function works are below.

Philip E. Higuera, Linda B. Brubaker, Patricia M. Anderson, Feng Sheng Hu, and Thomas A. Brown. 2009. Vegetation mediated the impacts of postglacial climate change on fire regimes in the south-central Brooks Range, Alaska. Ecological Monographs 79:201–219.

README:

To use the function wbl_LRT.m, save the file in the working directory or in the search path of Matlab. You must pass the function three variables:

1. FRI_data: observed (fire) return intervals organized in columns, where each column (j) represents one population that will be compared to all other populations, and each row (i) is an observed return interval. Empty cells must contain “NaN’, such that the final matrix has no blank values.

2. alpha: specifies the significance level for the test, e.g. 0.05.

3. n_perm: specifies the number of permutations to use in the permutation test to estimate theprobability of Type I error, p. If sample sizes are large (e.g. > 30), you can set n_perm equal to 0, in which case p is calculated from a Chi-squared distribution.

For example, in Matlab, you would define these variables, and then enter in the command line: [H,P,N] = wbl_LRT (FRI_data,alpha,n_perm)

After the function has run (which can take a few minutes, depending on the value of n_perm), the program returns two matrices, H and P, where each row (i) corresponds to populations 1 through n-1, where n is the total number of populations being compared (i.e. columns in FRI_data), and each column (j) corresponds to populations 2 through n. The values in the matrix are the results of comparing population i to population j, and therefore half of the matrix will be blank (NaN). The variable P contains the probability of Type I error, and thematrix H contains a “1” where the probability of Type I error is < alpha, and a 0 otherwise. The variable N contains the number of return intervals in each population (column) in FRI_data.

The symbol “%” signifies code that is commented out. Text following “%” is to be read to help understand the function.

History

Usage metrics

    Licence

    Exports

    RefWorks
    BibTeX
    Ref. manager
    Endnote
    DataCite
    NLM
    DC