csgillespie / poweRlaw

This package implements both the discrete and continuous maximum likelihood estimators for fitting the power-law distribution to data. Additionally, a goodness-of-fit based approach is used to estimate the lower cutoff for the scaling region.
109 stars 24 forks source link

Support for new/custom distributions? #17

Open russellcthomas opened 10 years ago

russellcthomas commented 10 years ago

I wonder if it would be possible to add functionality for new or custom distributions. For example, I'd like to fit and test power law with exponential cutoff (like the Python package does), but also others, like Stretched Exponential, Weibull, Generalized Exponential, and even Lognormal with Exponential cutoff.

Maybe this is already possible. If so, a tutorial would be very helpful.

csgillespie commented 10 years ago

This is a great idea and is something that I intend to do. I'll try and write a vignette about it in the near future.

NemiV commented 9 years ago

Hi, is there anyway I can plot weibull distrbution (similar to the way we plot powerlaw and lognormal) using rpowerlaw package or any other package? I cannot figure out how plot(m) works (to be able to edit it for weibull manually), where m is a reference object created using one of the distribution function.

csgillespie commented 8 years ago

Unfortunately, you'll need to create a reference class implementation of the weibull distribution. I'll create an issue and will hopefully get round to it soon

smy310 commented 4 years ago

Unfortunately, you'll need to create a reference class implementation of the weibull distribution. I'll create an issue and will hopefully get round to it soon

Hi Gillespie,

May I know if there is already function for Weibull (stretched exponential) distribution and discrete power law with exponential cut-off added to package?

Many thanks!

BR, Mengyun

hrlai commented 2 years ago

Hi all, related also to #63, I think we already have a function for Weibull conweibull, which is not yet documented in the helpfile, but you can just use it as any other con* distributions. It seems that you can specify xmin for conweibull, but I am not 100% sure if this will give us a truncated Weibull. It'd be great if this is actually what we get.

I tried to manually cutoff my data using a threshold, then fit power to x < threshold, and a Weibull tail to x > threshold, but the parameters are not corrected to join the "broken stick" distribution at the threshold... so any help with this would be greatly appreciated :)