Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- If it will be helpful, please like this post
- """
- #https://stats.stackexchange.com/questions/302774/does-uniform-distribution-belong-to-location-and-scale-familya
- def get_upd_distr(dict_: dict):
- full_dict = {}
- for key, values in dict_.items():
- if key not in full_dict:
- full_dict[key] = {}
- if key == "norm":
- if 'mean' not in full_dict[key]:
- full_dict[key]['mean'] = values[0]
- if 'sd' not in full_dict[key]:
- full_dict[key]['sd'] = values[1]
- if key == "cauchy":
- #https://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm
- if 't' not in full_dict[key]:
- full_dict[key]['t'] = values[0]
- if 's' not in full_dict[key]:
- full_dict[key]['s'] = values[1]
- if key == 'expon':
- if 'Xmin' not in full_dict[key]:
- full_dict[key]['Xmin'] = values[0]
- if '1/lambda' not in full_dict[key]:
- full_dict[key]['1/lambda'] = values[1]
- if key == "chi2":
- #https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm
- #https://web.ma.utexas.edu/users/mks/M358KInstr/tDistandDF.pdf
- if 'df' not in full_dict[key]:
- full_dict[key]['df'] = values[0]
- if 'mean' not in full_dict[key]:
- full_dict[key]['mean'] = values[1]
- if 'sd' not in full_dict[key]:
- full_dict[key]['sd'] = values[2]
- if key == "lognorm":
- #https://statisticsbyjim.com/probability/lognormal-distribution/
- #https://stackoverflow.com/questions/8747761/scipy-lognormal-distribution-parameters
- if 'sd' not in full_dict[key]:
- full_dict[key]['sd'] = values[0]
- if 'mean' not in full_dict[key]:
- full_dict[key]['mean'] = values[1]
- if 'alpha' not in full_dict[key]:
- full_dict[key]['alpha'] = values[2]
- if key == 'uniform':
- #https://statisticsbyjim.com/probability/gamma-distribution/
- if 'a' not in full_dict[key]:
- full_dict[key]['a'] = values[0]
- if '|b-a|' not in full_dict[key]:
- full_dict[key]['|b-a|'] = values[1]
- if key == 'rayleigh':
- #https://anylogic.help/advanced/functions/rayleigh.html
- #https://stats.stackexchange.com/questions/224416/parameter-estimation-of-a-rayleigh-random-variable-with-an-offset --useful
- if 'mean' not in full_dict[key]:
- full_dict[key]['mean'] = values[0]
- if 'sd' not in full_dict[key]:
- full_dict[key]['sd'] = values[1]
- if key == 'powerlaw': #TODO understand what is it
- if 'alpha' not in full_dict[key]:
- full_dict[key]['alpha'] = values[0]
- if 'Xmin' not in full_dict[key]:
- full_dict[key]['Xmin'] = values[1]
- if 'D' not in full_dict[key]:
- full_dict[key]['D'] = values[2]
- if key == 'exponpow': #TODO understand what is it
- if 'b' not in full_dict[key]:
- full_dict[key]['b'] = values[0]
- if 'loc' not in full_dict[key]:
- full_dict[key]['loc'] = values[1]
- if 'scale' not in full_dict[key]:
- full_dict[key]['scale'] = values[2]
- if key == 'gamma':
- #https://stackoverflow.com/questions/2896179/fitting-a-gamma-distribution-with-python-scipy
- #https://statisticsbyjim.com/probability/gamma-distribution/
- #https://en.wikipedia.org/wiki/Gamma_distribution
- #https://pythonguides.com/python-scipy-stats-fit/
- if 'alpha' not in full_dict[key]:
- full_dict[key]['alpha'] = values[0]
- if 'loc' not in full_dict[key]:
- full_dict[key]['loc'] = values[1]
- if 'beta' not in full_dict[key]:
- full_dict[key]['beta'] = values[2]
- if key == 'beta':
- # https://stats.stackexchange.com/questions/68983/beta-distribution-fitting-in-scipy
- if 'alpha' not in full_dict[key]:
- full_dict[key]['alpha'] = values[0]
- if 'beta' not in full_dict[key]:
- full_dict[key]['beta'] = values[1]
- if 'lower limit' not in full_dict[key]:
- full_dict[key]['lower limit'] = values[2]
- if 'upper limit - lower limit' not in full_dict[key]:
- full_dict[key]['upper limit - lower limit'] = values[3]
- if key == 'burr':
- """
- In terms of mathematical statistics, the loc and scale parameters for the Burr distribution correspond to the shift and scale parameters.
- 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).
- 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.
- So you can rewrite the values of loc and scale in terms of mathematical statistics as follows:
- Shift (loc):μ=loc
- Scale (scale):σ=scale
- Here
- μ is the mean (shift), and σ is the standard deviation (scale).
- """
- if 'c' not in full_dict[key]:
- full_dict[key]['c'] = values[0]
- if 'd' not in full_dict[key]:
- full_dict[key]['d'] = values[1]
- if 'mean' not in full_dict[key]:
- full_dict[key]['mean'] = values[2]
- if 'sd' not in full_dict[key]:
- full_dict[key]['sd'] = values[3]
- return full_dict
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement