dfm_module module

dfm_module.cdf_exponential(rate, scale=1, x=None, num=1000, plot=False, seed=None, bins=100)

This function generates the cumulative distribution function of the exponential distributin function with the given parameters.

Parameters:
  • shape – [req] rate of the exponenetial distribution which is mean (arriavl rate) of its Poisson distribution.

  • x – [optional] any positive real number within the range of CDF, if given the CDF will be calculated until this point.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,cumSum,bins, fig:

s is the 1D-array of generated values, cumSum is the 1D-array of calculated cumulative probability values, bins is the 1D-array of bins edges, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> s,cdf,bins,fig=cdf_exponential(rate=3,plot=True,seed=148)
>>> print(cdf)
[0.059 0.117 0.172 0.235 0.292 0.334 0.392 0.443 0.473...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.cdf_normal(mean, sd, x=None, num=1000, plot=False, seed=None, bins=100)

This function generates the cumulative distribution function of the normal distributin function with the given parameters.

Parameters:
  • mean – [req] the mean of the distribution

  • sd – [req] the standard deviation of the distribution

  • x – [optional] if any value is given the cdf will be generated only upto x.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,cumSum,bins, fig:

s is the 1D-array of generated values, cumSum is the 1D-array of calculated cumulative probability values, bins is the 1D-array of bins edges, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> s,cdf,bins,fig=cdf_normal(mean=0,sd=1,x=1,plot=True,seed=145)
>>> print(cdf)
[0.001      0.001      0.001      0.001      0.001      0.001...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.cdf_poisson(mean=1, x=None, num=1000, plot=False, seed=None)

This function generates the cumulative distribution function of the Poisson distributin function with the given parameters.

Parameters:
  • mean – [req] mean of the Poisson distribution.

  • x – [optional] any positive integer within the range of CDF, if given CDF will be calculated until this point.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,cumSum,bins, fig:

s is the 1D-array of generated values, cumSum is the 1D-array of calculated cumulative probability values, bins is the 1D-array of bins, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> s,cdf,bins,fig=cdf_poisson(mean=3,plot=True,seed=148)
>>> print(cdf)
[0.047 0.191 0.414 0.641 0.803...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.cdf_triangular(low, mode, high, x=None, num=1000, plot=False, seed=None, bins=100)

This function generates the cumulative distribution function of the triangular distributin function with the given parameters.

Parameters:
  • low – [req] the lowest number in triangular distribution.

  • mode – [req] the mode of the triangular distribution.

  • high – [req] the highest number in triangular distribution.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,cumSum,bins, fig:

s is the 1D-array of generated values, cumSum is the 1D-array of calculated cumulative probability values, bins is the 1D-array of bins edges, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> s,cdf,bins,fig=cdf_triangular(low=4,mode=8,high=12,x=6,plot=True,seed=148)
>>> print(cdf)
[0.001      0.001      0.001      0.002      0.003      0.005...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.cdf_weibull(shape, scale=1, x=None, num=1000, plot=False, seed=None, bins=100)

This function generates the cumulative distribution function of the weibull distributin function with the given parameters.

Parameters:
  • shape – [req] shape of the weibull distribution.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,cumSum,bins, fig:

s is the 1D-array of generated values, cumSum is the 1D-array of calculated cumulative probability values, bins is the 1D-array of bins edges, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> s,cdf,bins,fig=cdf_weibull(shape=3,plot=True,seed=148)
>>> print(cdf)
[0.001 0.001 0.001 0.001 0.002 0.002 0.005 0.007 0.008 0.009 0.01  0.01...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.number_of_simsulaions(standard_error_of_mean, confidence_level, standard_normal_statistics, standard_deviaton_of_the_output)
dfm_module.pdf_exponential(rate, num=1000, plot=False, seed=None, bins=100)

This function generates the exponential probabiliyt density function, for a given mean value.

Parameters:
  • shape – [req] rate of the exponenetial distribution which is mean (arriavl rate) of its Poisson distribution.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,counts,bins, fig:

s is the 1D-array of generated samples, counts is the 1D-array of corresponding probability values to different bins, bins is the 1D-array of bins edges, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> samples,pr,bins,fig=pdf_exponential(rate=2,plot=True,seed=15)
>>> print(samples)
[1.24985756e+00 7.61165330e-01 1.45083129e-01 2.05765792e-02...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.pdf_normal(mean, sd, num=1000, plot=False, seed=None, bins=100)

This function generates the normal (Gaussian) distribution, for a given mean value and standard deviation.

Parameters:
  • mean – [req] the mean of the distribution

  • sd – [req] the standard deviation of the distribution

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,counts,bins, fig:

s is the 1D-array of generated samples, counts is the 1D-array of corresponding probability values to different bins, bins is the 1D-array of bins edges, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> samples,pr,bins,fig=pdf_normal(mean=20,sd=2,plot=True,seed=12)
>>> print(samples)
[19.98634644 22.09228658 21.48317684 21.44791308 ...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.pdf_poisson(mean=1, num=1000, plot=False, seed=None)

This function generates the Poisson probabiliyt mass function, for a given mean value.

Parameters:
  • mean – [req] mean of the Poisson distribution.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,counts,bins, fig:

s is the 1D-array of generated samples, counts is the 1D-array of corresponding probability values to different bins, bins is the 1D-array of bins, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> samples,pr,bins,fig=pdf_poisson(mean=2,plot=True,seed=15)
>>> print(samples)
[3 1 2...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.pdf_triangular(low, mode, high, num=1000, plot=False, seed=None, bins=100)

This function generates the triangular probabiliyt density function, for a given low, mode and high values.

Parameters:
  • low – [req] the lowest number in triangular distribution.

  • mode – [req] the mode of the triangular distribution.

  • high – [req] the highest number in triangular distribution.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,counts,bins, fig:

s is the 1D-array of generated samples, counts is the 1D-array of corresponding probability values to different bins, bins is the 1D-array of bins edges, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> samples,pr,bins,fig=pdf_triangular(low=1.9,mode=2,high=2.1,plot=True,seed=12)
>>> print(samples)
[1.97082718 2.06736656 1.96153379 ...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————

dfm_module.pdf_weibull(shape, scale=1, num=1000, plot=False, seed=None, bins=100)

This function generates the Weibull probabiliyt density function, for a given shape factor.

Parameters:
  • shape – [req] shape of the weibull distribution.

  • num – [optional] number of samples, by default 1000.

  • plot – [optional] if True a figure will also be returned.

  • seed – [optional] use the same seed number to produce the same distribution.

  • bins – [optional] number of bins to divide the number of samples to. Default value is 100.

Return s,counts,bins, fig:

s is the 1D-array of generated samples, counts is the 1D-array of corresponding probability values to different bins, bins is the 1D-array of bins edges, and fig is to retrieve generated figure, only if plot is set to True.

Example:
>>> from PyWinda import pywinda as pw
>>> samples,pr,bins,fig=pdf_weibull(shape=2,plot=True,seed=15)
>>> print(samples)
[1.58104874 1.23382765 0.53867083 0.20286241 1.24978154 0.49239706...]
>>> print(fig)
Figure(1000x800)

-———————————————————————————————————————————————————