Skip to content

UnofficialJuliaMirrorSnapshots/MaximumLikelihoodPower.jl-b27c85e4-d77a-5c9d-b9af-900830bae76b

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MaximumLikelihoodPower

Linux, OSX: Build Status   Windows: Build Status       Coverage Status codecov.io

Physicists love power laws. But, they don't always use the best methods for extracting powers from empirical data.

Notebook example

Here is a notebook using MaximumLikelihoodPower.jl (this notebook is in the Notebooks folder in this distribution).

Command-line example

import MaximumLikelihoodPower
const MLE = MaximumLikelihoodPower

julia> seed = 11; α = 0.5;

# Get 10^6 samples from the Pareto distribution
julia> data = MLE.Example.makeparetodata(α, seed);

# Minimize the Kolmogorov-Smirnov statistic
# The second value returned is the minimizing alpha
julia> MLE.scanKS(data, range(.4, length=11, stop=.6))
3-element Array{Float64,1}:
 0.48
 0.5
 0.52

Functions

mle

    (estimate, stderr) = mle(data::AbstractVector)

Return the maximum likelihood estimate and standard error of the exponent of a power law applied to the sorted vector data.

KSstatistic

    KSstatistic(data::AbstractVector, alpha) --> Float64

Return the Kolmogorov-Smirnov statistic comparing data to a power law with power alpha. The elements of data are assumed to be unique. Minimizing the KS statistic over alpha is another way to estimate the parameter of the sample distribution. See testKS in the test directory.

scanKS(data, powers)

Compute the Kolmogorov Smirnov statistic for several values of α in the iterator powers. Return the value of α that minimizes the KS statistic and the two neighboring values.

mleKS

    mleKS{T<:AbstractFloat}(data::AbstractVector{T})

Return the maximum likelihood estimate and standard error of the exponent of a power law applied to the sorted vector data. Also return the Kolmogorov-Smirnov statistic. Results are returned in an instance of type MLEKS.

scanmle

    scanmle(data::AbstractVector; ntrials=100, stderrcutoff=0.1, useKS=false)

Perform mle approximately ntrials times on data, increasing xmin. Stop trials if the stderr of the estimate alpha is greater than stderrcutoff. Return an object containing statistics about the scan.

comparescan

    comparescan(mle::MLEKS, i, data, mlescan::MLEScan)

compare the results of MLE estimation mle to record results in mlescan and update mlescan.

Reference

Clauset, A., Shalizi, C. R., & Newman, M. E. J. (2009). Power-Law Distributions in Empirical Data. SIAM Review, 51(4), 661–703. http://dx.doi.org/10.1137/070710111, https://arxiv.org/abs/0706.1062

About

Last snapshots taken from https://github.com/UnofficialJuliaMirror/MaximumLikelihoodPower.jl-b27c85e4-d77a-5c9d-b9af-900830bae76b on 2019-11-20T09:30:38.709-05:00 by @UnofficialJuliaMirrorBot via Travis job 153.23 , triggered by Travis cron job on branch "master"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published