pydfnWorks
python wrapper for dfnWorks
pydfnworks.dfnGen.generation.output_report.distributions Namespace Reference

Functions

def tpl_cdf (xmin, alpha, x)
 Truncated Power Law Distribution Functions ########. More...
 
def tpl_pdf (norm_const, xmin, alpha, x)
 
def tpl (alpha, xmin, xmax)
 
def exp_pdf (norm_const, eLambda, x)
 Exponential Distribution Functions ########. More...
 
def exp_cdf (eLambda, x)
 
def exponential (eLambda, xmin, xmax)
 
def lognormal_cdf (x, mu, sigma)
 Log-Normal Distribution Functions ########. More...
 
def lognormal_pdf (x, mu, sigma)
 
def lognormal (mu, sigma, xmin, xmax)
 
def create_ecdf (vals)
 

Detailed Description

  :filename: distributions.py
  :synopsis: Analytic expressions for fracture radii distributions
  :version: 1.0
  :maintainer: Jeffrey Hyman 
  :moduleauthor: Jeffrey Hyman <jhyman@lanl.gov>

Function Documentation

◆ create_ecdf()

def pydfnworks.dfnGen.generation.output_report.distributions.create_ecdf (   vals)
  Returns the Empirical Cumulative Density function of provided values 

Parameters
----------
    vals : array
       array of values to be binned

Returns
-------
    x : numpy array
        sorted input values
    cdf : numpy array
        values of the cdf, normalized so cumulative sum = 1

Notes
------
    None

Definition at line 271 of file distributions.py.

◆ exp_cdf()

def pydfnworks.dfnGen.generation.output_report.distributions.exp_cdf (   eLambda,
  x 
)
 Returns the analytical values of the CDF of the exponential distribution with exponent eLambda for values of x.

Parameters
-------------
    eLambda  : double
        The exponent of the exponential distribution
    x : numpy array
        x-values of the function
Returns
--------
    cdf : numpy array
        Analytical values of the exponential CDF

Notes
---------
    None

Definition at line 118 of file distributions.py.

Referenced by pydfnworks.dfnGen.generation.output_report.distributions.exponential().

Here is the caller graph for this function:

◆ exp_pdf()

def pydfnworks.dfnGen.generation.output_report.distributions.exp_pdf (   norm_const,
  eLambda,
  x 
)

Exponential Distribution Functions ########.

 Returns the analytical values of the PDF of the exponential distribution with exponent eLambda for values of x.

Parameters
-------------
    norm_const : double 
        The normalization constant for the PDF
    eLambda  : double
        The exponent of the exponential distribution
    x : numpy array
        x-values of the function
Returns
--------
    pdf : numpy array
        Analytical values of the power law PDF

Notes
---------
    None

Definition at line 94 of file distributions.py.

Referenced by pydfnworks.dfnGen.generation.output_report.distributions.exponential().

Here is the caller graph for this function:

◆ exponential()

def pydfnworks.dfnGen.generation.output_report.distributions.exponential (   eLambda,
  xmin,
  xmax 
)
 Returns the PDF and CDF of an exponential distribution with exponent eLambda over the range [xmin,xmax]. 

Parameters
-----------
    eLambda  : double
        The exponent of the exponential distribution
    xmin : double
        Minimum x-value
    xmax : double
        Maximum x-value

Returns
---------
    x : numpy array
        x-values of the function
    pdf : numpy array
        pdf values of the exponential distribution
    cdf : numpy array
        cdf values of exponential distribution

Notes
-------
    None

Definition at line 141 of file distributions.py.

References pydfnworks.dfnGen.generation.output_report.distributions.exp_cdf(), and pydfnworks.dfnGen.generation.output_report.distributions.exp_pdf().

Here is the call graph for this function:

◆ lognormal()

def pydfnworks.dfnGen.generation.output_report.distributions.lognormal (   mu,
  sigma,
  xmin,
  xmax 
)
 Returns the PDF and CDF of a LogNormal distribution with parameters mu and sigma over the range [xmin,xmax]. 

Parameters
-----------
    mu  : double
        Lognormal distribution parameter #1
    sigma : double
        Lognormal distribution parameter #1 (sigma > 0)
    xmin : double
        Minimum x-value
    xmax : double
        Maximum x-value

Returns
---------
    x : numpy array
        x-values of the function
    pdf : numpy array
        pdf values of the lognormal distribution
    cdf : numpy array
        cdf values of lognormal distribution

Notes
-------
    dfnGen uses the mean and standard deviation of the underlying normal distribution that creates the lognormal distribution. 

    In order to produce a LogNormal distribution with a desired mean (m) and variance (s) one uses

    mu = ln [ m^2 / sqrt(m^2 + s^2)]

    and 

    sigma = ln ( 1 + m^2 / s^2)

    For more details see https://en.wikipedia.org/wiki/Log-normal_distribution

Definition at line 225 of file distributions.py.

References pydfnworks.dfnGen.generation.output_report.distributions.lognormal_cdf(), and pydfnworks.dfnGen.generation.output_report.distributions.lognormal_pdf().

Here is the call graph for this function:

◆ lognormal_cdf()

def pydfnworks.dfnGen.generation.output_report.distributions.lognormal_cdf (   x,
  mu,
  sigma 
)

Log-Normal Distribution Functions ########.

 Returns the analytical values of the CDF of the lognormal distribution with parameters mu and sigma

Parameters
-------------
    x : numpy array
        x-values of the function
    mu  : double
        Lognormal distribution parameter #1
    sigma : double
        Lognormal distribution parameter #1 (sigma > 0)            
Returns
--------
    cdf : numpy array
        Analytical values of the CDF for the Log-Normal distribution

Notes
---------
    None

Definition at line 175 of file distributions.py.

Referenced by pydfnworks.dfnGen.generation.output_report.distributions.lognormal().

Here is the caller graph for this function:

◆ lognormal_pdf()

def pydfnworks.dfnGen.generation.output_report.distributions.lognormal_pdf (   x,
  mu,
  sigma 
)
 Returns the analytical values of the CDF of the lognormal distribution with parameters mu and sigma

Parameters
-------------
    x : numpy array
        x-values of the function
    mu  : double
        Lognormal distribution parameter #1
    sigma : double
        Lognormal distribution parameter #1 (sigma > 0)            
Returns
--------
    pdf : numpy array
        Analytical values of the PDF for the Log-Normal distribution

Notes
---------
    None

Definition at line 199 of file distributions.py.

Referenced by pydfnworks.dfnGen.generation.output_report.distributions.lognormal().

Here is the caller graph for this function:

◆ tpl()

def pydfnworks.dfnGen.generation.output_report.distributions.tpl (   alpha,
  xmin,
  xmax 
)
 Returns the PDF and CDF of a truncated Power-law distribution with exponent alpha over the range [xmin,xmax]. 

Parameters
-----------
    alpha  : double
         The alpha parameter (decay rate / exponent) in the power law distribution. (alpha > 0)
    xmin : double
        Minimum x-value
    xmax : double
        Maximum x-value

Returns
---------
    x : numpy array
        x-values of the function
    pdf : numpy array
        pdf values of the truncated powerlaw
    cdf : numpy array
        cdf values of truncated powerlaw distribution

Notes
-------
    dfnWorks uses the convention of pdf(x) = C x^{-(alpha +1)}, rather than pdf(x) = C x^{-alpha} for a powerlaw.

Definition at line 58 of file distributions.py.

References pydfnworks.dfnGen.generation.output_report.distributions.tpl_cdf(), and pydfnworks.dfnGen.generation.output_report.distributions.tpl_pdf().

Here is the call graph for this function:

◆ tpl_cdf()

def pydfnworks.dfnGen.generation.output_report.distributions.tpl_cdf (   xmin,
  alpha,
  x 
)

Truncated Power Law Distribution Functions ########.

 Returns the analytical values of the power law CDF with exponent a

Parameters
--------------
    xmin : double
        The lower bound of the truncated power law distribution.
    alpha  : double
         The alpha parameter in the power law distribution.
    x : numpy array
        x values

Returns
----------
    cdf : numpy array
        Analytical values of the power law CDF

Definition at line 14 of file distributions.py.

Referenced by pydfnworks.dfnGen.generation.output_report.distributions.tpl().

Here is the caller graph for this function:

◆ tpl_pdf()

def pydfnworks.dfnGen.generation.output_report.distributions.tpl_pdf (   norm_const,
  xmin,
  alpha,
  x 
)
 Returns the analytical power laws PDF values.

Parameters
--------------
    norm_const : double 
        The normalization constant for the PDF
    xmin : double
        The lower bound of the truncated power law distribution.
    alpha  : double
         The alpha parameter (decay rate / exponent) in the power law distribution.
    x : numpy array
        x-values of the function
Returns
--------
    pdf : numpy array
        Analytical values of the power law PDF

Definition at line 35 of file distributions.py.

Referenced by pydfnworks.dfnGen.generation.output_report.distributions.tpl().

Here is the caller graph for this function: