scipy stats.frechet_l () | python

Parameters:
– & gt; q: lower and upper tail probability
– & gt; a: shape parameters
– & gt; x: quantiles
– & gt; loc: [optional] location parameter. Default = 0
– & gt; scale: [optional] scale parameter. Default = 1
– & gt; size: [tuple of ints, optional] shape or random variates.
– & gt; moments: [optional] composed of letters [`mvsk`]; `m` = mean, `v` = variance,
`s` = Fisher`s skew and `k` = Fisher`s kurtosis. (default = `mv`).

Results: Frechet left continuous random variable

Code # 1: Create left continuous random variable random variable Frechet

from scipy.stats import frechet_l 

  

numargs = frechet_l .numargs

[a] = [ 0.7 ,] * numargs

rv = frechet_l (a)

 

print ( "RV:" , rv) 

Output:

 RV: & lt; scipy.stats._distn_infrastructure.rv_frozen object at 0x0000018D578BC9E8 & gt; 

Code # 2: Frechet left random changes and probability distributions.

import numpy as np

quantile = np.arange ( 0.01 , 1 , 0.1 )

 
# Random Variants

R = frechet_l.rvs (a, scale = 2 , size = 10 )

print ( " Random Variates: " , R)

 
# PDF

R = frechet_l.pdf (a, quantile, loc = 0 , scale = 1 )

print ( " Probability Distribution: " , R)

Output:

 Random Variates: [-4.66775585e-02 -3.75425255 e + 00 -2.32248407e-01 -1.20807347e-03 -6.26373883e + 00 -1.14007755e + 00 -5.09499683e + 00 -4.18191271e-01 -4.33720753e + 00 -1.05442843e + 00] Probability Distribution: [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] 

Code # 3: Various Positional Arguments

import matplotlib.pyplot as plt

import numpy as np

 

x = np.linspace ( 0 , 5 , 100 )

 
# Various positional arguments

y1 = frechet_l.pdf (x, 1 , 3 )

y2 = frechet_l.pdf (x, 1 , 4 )

plt.plot (x, y1, "*" , x, y2, "r--" )

Output: