1
$\begingroup$

I have a dataset and I am wondering if would be a reasonable fit for a number of distribution types.

I was looking to fit the Burr XII distribution in Python initially (using scipy library) and then validate the result using the R actuar library.

As I received different results for the estimates of the shape1, shape2 and scale parameters between the two libraries I would like to understand how to compute the estimates myself (i.e. outside of actuar/scipy)

Just to give an idea of the differences:

In R (actuar)

#shape1 R  =   0.066311696290154
#shape2 R   = 13.412776829494927
#scale R  =    4.3465794231141

In Python (Python)

#shape1 Py = 108.33525966683732
#shape2 Py =   0.008276941245923156
#scale Py =    4.388707206455431

From what I can gather it appears that the shape1 & 2 are flipped between Python and R.

Here is some sample code to reproduce in R:

library(actuar)

burr_sample <- c(5.35382659682693, 4.74764035328555, 6.41688382297086, 4.70194010676229,
4.45113004935033, 4.50611840443683, 8.03060660585978, 4.5695082533874,
4.48052843925116, 5.05598541072842, 4.99368090343132, 4.63153147946491,
4.68443593804105, 5.02826922164524, 210.415754831859, 114.311867979766,
611.092749788117, 4.502751256927, 4.57870681149377, 5.11299025815068,
5.31665861351517, 14.8465590392403, 5.58683130567932,15.9141068218137,
11.6050958855081, 10.175418658569, 109.160688760136, 8.28179845669206,
4.54159063565775, 22.8318960824204, 8.82622790142304, 4.88362864083956,
9.42213684934793, 84.7237613685393, 7.60704879618404, 46.393548985959,
4.86797703394291, 89.5695808475361, 8.43029961651323, 4.67889028482232,
75.3616899071995, 5.31730051442045, 18.729798449272, 9.9174137219138,
79.9573773033068, 15.069030596827, 66.7713319465588, 11.8175710845523,
7.87392052996755, 3072.60557504056, 14.3601404431787, 5.03732319328952)

burr_fit <- fitdist(burr_sample,"burr",method="mle", start = list(shape1 = 0.24, 
                                                                  shape2 = 0.5, 
                                                                  rate = 5))

summary(burr_fit) # shape1 =  0.066311696290154  shape2 = 13.412776829494927, scale = 1/0.240613220041504 = 4.3465794231141
In Python:

burr_sample= [5.35382659682693, 4.74764035328555, 6.41688382297086, 4.70194010676229,
4.45113004935033, 4.50611840443683, 8.03060660585978, 4.5695082533874,
4.48052843925116, 5.05598541072842, 4.99368090343132, 4.63153147946491,
4.68443593804105, 5.02826922164524, 210.415754831859, 114.311867979766,
611.092749788117, 4.502751256927, 4.57870681149377, 5.11299025815068,
5.31665861351517, 14.8465590392403, 5.58683130567932,15.9141068218137,
11.6050958855081, 10.175418658569, 109.160688760136, 8.28179845669206,
4.54159063565775, 22.8318960824204, 8.82622790142304, 4.88362864083956,
9.42213684934793, 84.7237613685393, 7.60704879618404, 46.393548985959,
4.86797703394291, 89.5695808475361, 8.43029961651323, 4.67889028482232,
75.3616899071995, 5.31730051442045, 18.729798449272, 9.9174137219138,
79.9573773033068, 15.069030596827, 66.7713319465588, 11.8175710845523,
7.87392052996755, 3072.60557504056, 14.3601404431787, 5.03732319328952]

random.seed(421)
burr_fit = stats.burr12.fit(burr_sample, 0.5 , 0.24 , floc=0, scale = 5)
print(burr_fit)
(108.34090735484176, 0.008357900741996344, 0, 4.388113415121694)

If folks have any suggestions of sources to obtain equations to estimate parameters via MLE that would be much appreciated.

I am reading the following paper: https://www.researchgate.net/profile/Fu-Kwun-Wang/publication/227617903_Robust_regression_for_estimating_the_Burr_XII_parameters_with_outliers/links/5407c9aa0cf2bba34c247139/Robust-regression-for-estimating-the-Burr-XII-parameters-with-outliers.pdf

The paper looks to estimate parameters c and k, please let me know if this is a useful place to start.

Finally, I should add that if I generate a burr xii distribution using:

rburr(50, 2,2, 0.2)

I get very similar results parameter results in R and Python. So I am wondering if my sample dataset is causing issues with parameter estimates.

Regards Jonathan

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.