Hi all. I have analyses that need parts of the calculations in stats.levy_stable._fitstart(). I am willing to put them into a formal PR if people think it would be useful to refactorize _fitstart() to re-use these calculations. Current processing .fitstart() takes an array of data samples, and returns parameter estimates for a stable distribution fit to those samples. Stage 1 calculates quintiles from the samples (percentiles 5, 25, 50, 75, 95). Stage 2 estimates shape parameters from the quintiles. Stage 3 estimates location and scale parameters from the quintiles and the estimated shape parameters. Use cases I have some data that is already aggregated to percentiles. For this use case, I need Stage 2 and Stage 3. I also have some related data that is aggregated to quintiles (percentiles 10, 25, 50, 75, 90). These quintiles do not go far enough into the tails to inform an estimate of alpha. However, if I assume that the shape parameters are the same throughout, then I need a slightly-adapted Stage 3 to estimate the location and scale for each quintile distribution (using fixed alpha and beta that have been determined from other data). Refactorization Would it be useful to make some form of Stages 2 and 3 available separately within scipy.stats.levy_stable? If so, should it be via public API? Thanks in advance for your thoughts and any advice on how best to proceed. Todd
participants (1)
-
Todd Bailey