HazardFunction

HazardFunction[dist,x]

gives the hazard function for the distribution dist evaluated at x.

HazardFunction[dist,{x1,x2,}]

gives the multivariate hazard function for the distribution dist evaluated at {x1,x2,}.

HazardFunction[dist]

gives the hazard function as a pure function.

Details

  • HazardFunction is also known as a force of mortality.
  • For continuous distributions, HazardFunction[dist,x] dx gives the probability that an observed value lies between x and x+dx, given that it is larger than x for infinitesimal dx.
  • For continuous distributions, HazardFunction[dist,x] dx is equivalent to Probability[xξ<x+dxξx,ξdist] for infinitesimal dx. »
  • For discrete distributions, HazardFunction[dist,x] is equivalent to Probability[ξxξx,ξdist].
  • For continuous multivariate distributions, HazardFunction[dist,{x1,,xn}]dx1 dxn is equivalent to Probability[x1ξ1<x1+dx1xnξn<xn+dxnξ1x1ξnxn,{ξ1,,ξn}dist].
  • For discrete multivariate distributions, HazardFunction[dist,{x1,,xn}] is equivalent to Probability[ξ1x1 ξnxnξ1x1ξnxn,{ξ1,,ξn}dist].

Examples

open allclose all

Basic Examples  (4)

A hazard function for a continuous univariate distribution:

The hazard function for a discrete univariate distribution:

A hazard function for a continuous multivariate distribution:

A hazard function for a discrete multivariate distribution:

Scope  (20)

Parametric Distributions  (6)

Obtain exact numeric results:

Obtain a machine-precision result:

Obtain a result at any precision for a continuous distribution:

Obtain a result at any precision for a discrete distribution with inexact parameters:

Hazard function for a multivariate distribution:

Obtain a symbolic expression for the hazard function:

Nonparametric Distributions  (3)

Hazard function for nonparametric distributions:

Compare with the value for the underlying parametric distribution:

Plot the survival function for a histogram distribution:

Plot of the survival function of a bivariate smooth kernel distribution:

Derived Distributions  (8)

Product of independent distributions:

Component mixture distribution:

Quadratic transformation of a discrete distribution:

Truncated distribution:

A copula distribution:

Formula distributions defined by its PDF:

Defined by its CDF:

Defined by its survival function:

Marginal distribution:

Hazard function for QuantityDistribution assumes the argument is a Quantity with compatible units:

This allows for direct quantity substitution:

Compare with direct use of quantity argument:

Random Processes  (3)

Find the hazard function for a SliceDistribution of a discrete-state random process:

A continuous-state random process:

Find the multiple time-slice hazard function for a discrete-state process:

A multi-slice for a continuous-state process:

Hazard function for the StationaryDistribution of a discrete-state random process:

Generalizations & Extensions  (1)

HazardFunction threads element-wise over lists:

Multivariate distributions:

Applications  (4)

Find the mortality rate for lifetime distributions including exponential distribution:

Gompertz distribution:

Given the reliability function of a component, compute its failure rate:

Define the corresponding probability distribution:

Compute the failure rate using the distribution:

Study the hazard function for a family of Weibull distributions:

With , used is better than new:

With , used is as good as new:

With , used is worse than new:

A casino offers you a game where you pay amount to participate and then choose a stake amount . A positive continuous random variable following a known distribution is then generated. If you collect the stake; otherwise you lose. Find the value that maximizes the profit:

Find the equation for the maximum of the expected gain:

Assuming WeibullDistribution, find the optimal stake size:

Properties & Relations  (3)

Compute the hazard function using the definition as conditional probability:

The hazard function is a ratio of the PDF and the survival function :

The hazard rate of an exponential distribution is constant:

Possible Issues  (2)

Symbolic closed forms do not exist for some distributions:

Numerical evaluation works:

Substitution of invalid values into symbolic outputs gives results that are not meaningful:

Passing it as an argument, it stays unevaluated:

Wolfram Research (2010), HazardFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/HazardFunction.html.

Text

Wolfram Research (2010), HazardFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/HazardFunction.html.

CMS

Wolfram Language. 2010. "HazardFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HazardFunction.html.

APA

Wolfram Language. (2010). HazardFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HazardFunction.html

BibTeX

@misc{reference.wolfram_2024_hazardfunction, author="Wolfram Research", title="{HazardFunction}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/HazardFunction.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_hazardfunction, organization={Wolfram Research}, title={HazardFunction}, year={2010}, url={https://reference.wolfram.com/language/ref/HazardFunction.html}, note=[Accessed: 21-December-2024 ]}