scipy.stats.erlang (): is a continuous random Erlang variable that is defined by a standard format and some form parameters to complete its specification. this is a special case of the gamma distribution.
Parameters: q: lower and upper tail probability x: quantiles loc: [optional] location parameter. Default = 0 scale: [optional] scale parameter. Default = 1 size: [tuple of ints, optional] shape or random variates. moments: [optional] composed of letters [’mvsk ’]; ’m’ = mean, ’v’ = variance, ’s’ = Fisher’s skew and ’k’ = Fisher’s kurtosis. (default = ’mv’).
Results: erlang continuous random variable
Code # 1: Generating a continuous random variable Erlang
from scipy.stats import erlang
numargs = erlang.numargs
[a] = [ 0.6 ,] * numargs
rv = erlang (a)
print ( "RV:" , rv)
Output:
RV : "scipy.stats._distn_infrastructure.rv_frozen object at 0x0000018D544FBC88"
Code # 2: Erlang Random Variables and Probability Distribution.
import numpy as np
quantile = np.arange ( 0.01 , 1 , 0.1 )
# Random Variants
R = erlang.rvs (a, scale = 2 , size = 10 )
print ( "Random Variates:" , R)
# PDF
R = erlang.pdf (a, quantile, loc = 0 , scale = 1 )