Advertisement
Danila_lipatov

parameters_of_common_distributions

Nov 2nd, 2023 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.68 KB | None | 0 0
  1. #https://stats.stackexchange.com/questions/302774/does-uniform-distribution-belong-to-location-and-scale-familya
  2. def get_upd_distr(dict_: dict):
  3.     for key, values in dict_.items():
  4.         if key == "norm":
  5.             values[0] = 'mean'
  6.             values[1] = 'sd'
  7.         if key == "cauchy":
  8.             #https://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm
  9.             values[0] = 't'       #t
  10.             values[1] = 's'     #s
  11.         if key == 'expon':
  12.             values[0] = 'min value'
  13.             values[1] = '1/lambda'
  14.         if key == "chi2":
  15.             #https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm
  16.             #https://web.ma.utexas.edu/users/mks/M358KInstr/tDistandDF.pdf
  17.             values[0] = 'df' #TODO understand
  18.             values[1] = 'mean'
  19.             values[2] = 'sd'
  20.         if key == "lognorm":
  21.             #https://statisticsbyjim.com/probability/lognormal-distribution/
  22.             #https://stackoverflow.com/questions/8747761/scipy-lognormal-distribution-parameters
  23.             values[0] = 'sd'       #shape
  24.             values[1] = 'mean'     #loc
  25.             values[2] = 'alpha'    #scale
  26.         if key == 'uniform':
  27.             #https://statisticsbyjim.com/probability/gamma-distribution/
  28.             values[0] = 'a'
  29.             values[1] = '|b-a|'
  30.         if key == 'rayleigh':
  31.             #https://anylogic.help/advanced/functions/rayleigh.html
  32.             #https://stats.stackexchange.com/questions/224416/parameter-estimation-of-a-rayleigh-random-variable-with-an-offset --useful
  33.             values[0] = 'mean'
  34.             values[1] = 'sd'
  35.         if key == 'powerlaw':   #TODO understand what is it
  36.             values[0] = 'alpha'
  37.             values[1] = 'Xmin'
  38.             values[2] = 'D' #Kolmogorov smirnov statistic
  39.         if key == 'exponpow':   #TODO understand what is it
  40.             values[0] = 'b'
  41.             values[1] = 'loc'
  42.             values[2] = 'scale'
  43.         if key == 'gamma':
  44.             #https://stackoverflow.com/questions/2896179/fitting-a-gamma-distribution-with-python-scipy
  45.             #https://statisticsbyjim.com/probability/gamma-distribution/
  46.             #https://en.wikipedia.org/wiki/Gamma_distribution
  47.             #https://pythonguides.com/python-scipy-stats-fit/
  48.             values[0] = 'alpha' #shape
  49.             values[1] = 'loc'   #scale
  50.             values[2] = 'betta' #thres
  51.         if key == 'beta':
  52.             # https://stats.stackexchange.com/questions/68983/beta-distribution-fitting-in-scipy
  53.             values[0] = 'alpha'
  54.             values[1] = 'beta'
  55.             values[2] = 'lower limit'
  56.             values[3] = 'upper limit - lower limit'
  57.         if key == 'burr':
  58.             """
  59.            In terms of mathematical statistics, the loc and scale parameters for the Burr distribution correspond to the shift and scale parameters.
  60.  
  61.            The loc parameter represents a shift (or offset) of the distribution along the axis of values. If loc is a, then the distribution will be shifted by a units to the right (positive value) or to the left (negative value).
  62.            The scale parameter represents the scale that affects the spread of the data. If scale is equal to b, then the distribution will be scaled along the axis of values.
  63.            So you can rewrite the values of loc and scale in terms of mathematical statistics as follows:
  64.  
  65.            Shift (loc):μ=loc
  66.  
  67.            Scale (scale):σ=scale
  68.  
  69.            Here
  70.            μ is the mean (shift), and σ is the standard deviation (scale).
  71.            """
  72.             values[0] = 'c' #tail parameter
  73.             values[1] = 'd'
  74.             values[2] = 'mean'
  75.             values[3] = 'sd'
  76.  
  77.  
  78.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement