EmpiricalHazardDistribution Class |
Namespace: Accord.Statistics.Distributions.Univariate
[SerializableAttribute] public class EmpiricalHazardDistribution : UnivariateContinuousDistribution, IFittableDistribution<double, SurvivalOptions>, IFittable<double, SurvivalOptions>, IFittable<double>, IFittableDistribution<double>, IDistribution<double>, IDistribution, ICloneable, IFittableDistribution<double, EmpiricalHazardOptions>, IFittable<double, EmpiricalHazardOptions>
The EmpiricalHazardDistribution type exposes the following members.
Name | Description | |
---|---|---|
EmpiricalHazardDistribution |
Initializes a new instance of the EmpiricalHazardDistribution class.
| |
EmpiricalHazardDistribution(SurvivalEstimator) |
Initializes a new instance of the EmpiricalHazardDistribution class.
| |
EmpiricalHazardDistribution(Double, Double) |
Initializes a new instance of the EmpiricalHazardDistribution class.
| |
EmpiricalHazardDistribution(Double, Double, SurvivalEstimator) |
Initializes a new instance of the EmpiricalHazardDistribution class.
|
Name | Description | |
---|---|---|
Entropy |
This method is not supported.
(Overrides UnivariateContinuousDistributionEntropy.) | |
Estimator |
Gets the survival function estimator being used in this distribution.
| |
Hazards |
Gets the hazard rate values at each time step.
| |
Mean |
Gets the mean for this distribution.
(Overrides UnivariateContinuousDistributionMean.) | |
Median |
Gets the median for this distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Mode |
This method is not supported.
(Overrides UnivariateContinuousDistributionMode.) | |
Quartiles |
Gets the Quartiles for this distribution.
(Inherited from UnivariateContinuousDistribution.) | |
StandardDeviation |
Gets the Standard Deviation (the square root of
the variance) for the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Support |
Gets the support interval for this distribution.
(Overrides UnivariateContinuousDistributionSupport.) | |
Survivals |
Gets the survival values at each time step.
| |
Times |
Gets the time steps of the hazard density values.
| |
Variance |
Gets the variance for this distribution.
(Overrides UnivariateContinuousDistributionVariance.) |
Name | Description | |
---|---|---|
Clone |
Creates a new object that is a copy of the current instance.
(Overrides DistributionBaseClone.) | |
ComplementaryDistributionFunction |
Gets the complementary cumulative distribution function
(ccdf) for this distribution evaluated at point x.
This function is also known as the Survival function.
(Inherited from UnivariateContinuousDistribution.) | |
CumulativeHazardFunction |
Gets the cumulative hazard function for this
distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionCumulativeHazardFunction(Double).) | |
DistributionFunction(Double) |
Gets the cumulative distribution function (cdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
DistributionFunction(Double, Double) |
Gets the cumulative distribution function (cdf) for this
distribution in the semi-closed interval (a; b] given as
P(a < X ≤ b).
(Inherited from UnivariateContinuousDistribution.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Estimate(Double, Double, SurvivalEstimator, HazardEstimator, HazardTiesMethod) |
Estimates an Empirical Hazards distribution considering event times and the outcome of the
observed sample at the time of event, plus additional parameters for the hazard estimation.
| |
Estimate(Double, SurvivalOutcome, Double, SurvivalEstimator, HazardEstimator, HazardTiesMethod) |
Estimates an Empirical Hazards distribution considering event times and the outcome of the
observed sample at the time of event, plus additional parameters for the hazard estimation.
| |
Estimate(Double, Int32, Double, SurvivalEstimator, HazardEstimator, HazardTiesMethod) |
Estimates an Empirical Hazards distribution considering event times and the outcome of the
observed sample at the time of event, plus additional parameters for the hazard estimation.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
Fit(Double) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, Double) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, Int32) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Fit(Double, Double, EmpiricalHazardOptions) |
Fits the underlying distribution to a given set of observations.
| |
Fit(Double, Double, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Overrides UnivariateContinuousDistributionFit(Double, Double, IFittingOptions).) | |
Fit(Double, Double, SurvivalOptions) |
Fits the underlying distribution to a given set of observations.
| |
Fit(Double, Int32, IFittingOptions) |
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.) | |
Generate |
Generates a random observation from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Int32) |
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Random) |
Generates a random observation from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Int32, Double) |
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Int32, Random) |
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
Generate(Int32, Double, Random) |
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetRange |
Gets the distribution range within a given percentile.
(Inherited from UnivariateContinuousDistribution.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HazardFunction |
Gets the hazard function, also known as the failure rate or
the conditional failure density function for this distribution
evaluated at point x.
(Overrides UnivariateContinuousDistributionHazardFunction(Double).) | |
InnerComplementaryDistributionFunction |
Gets the complementary cumulative distribution function
(ccdf) for this distribution evaluated at point x.
This function is also known as the Survival function.
(Overrides UnivariateContinuousDistributionInnerComplementaryDistributionFunction(Double).) | |
InnerDistributionFunction |
Gets the cumulative distribution function (cdf) for
this distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionInnerDistributionFunction(Double).) | |
InnerInverseDistributionFunction |
Gets the inverse of the cumulative distribution function (icdf) for
this distribution evaluated at probability p. This function
is also known as the Quantile function.
(Inherited from UnivariateContinuousDistribution.) | |
InnerLogProbabilityDensityFunction |
Gets the log-probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
InnerProbabilityDensityFunction |
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionInnerProbabilityDensityFunction(Double).) | |
InverseDistributionFunction |
Gets the inverse of the cumulative distribution function (icdf) for
this distribution evaluated at probability p. This function
is also known as the Quantile function.
(Inherited from UnivariateContinuousDistribution.) | |
LogCumulativeHazardFunction |
Gets the log of the cumulative hazard function for this
distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
LogProbabilityDensityFunction |
Gets the log-probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ProbabilityDensityFunction |
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.) | |
QuantileDensityFunction |
Gets the first derivative of the
inverse distribution function (icdf) for this distribution evaluated
at probability p.
(Inherited from UnivariateContinuousDistribution.) | |
Sort(Double, SurvivalOutcome) |
Sorts time-censored events considering their time of occurrence and the type of event.
Events are first sorted in decreased order of occurrence, and then with failures coming
before censoring.
| |
Sort(Double, SurvivalOutcome, Double) |
Sorts time-censored events considering their time of occurrence and the type of event.
Events are first sorted in decreased order of occurrence, and then with failures coming
before censoring.
| |
Sort(Double, SurvivalOutcome, Double) |
Sorts time-censored events considering their time of occurrence and the type of event.
Events are first sorted in decreased order of occurrence, and then with failures coming
before censoring.
| |
ToString |
Returns a String that represents this instance.
(Inherited from DistributionBase.) | |
ToString(IFormatProvider) |
Returns a String that represents this instance.
(Inherited from DistributionBase.) | |
ToString(String) |
Returns a String that represents this instance.
(Inherited from DistributionBase.) | |
ToString(String, IFormatProvider) |
Returns a String that represents this instance.
(Overrides DistributionBaseToString(String, IFormatProvider).) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
The Empirical Hazard (or Survival) Distribution can be used as an estimative of the true Survival function for a dataset which does not relies on distribution or model assumptions about the data.
The most direct use for this class is in Survival Analysis, such as when using or creating Cox's Proportional Hazards models.
// references http://www.statsdirect.com/help/default.htm#survival_analysis/kaplan_meier.htmThe following example shows how to construct an empirical hazards function from a set of hazard values at the given time instants.
// Consider the following observations, occurring at the given time steps double[] times = { 11, 10, 9, 8, 6, 5, 4, 2 }; double[] values = { 0.22, 0.67, 1.00, 0.18, 1.00, 1.00, 1.00, 0.55 }; // Create a new empirical distribution function given the observations and event times EmpiricalHazardDistribution distribution = new EmpiricalHazardDistribution(times, values); // Common measures double mean = distribution.Mean; // 2.1994135014183138 double median = distribution.Median; // 3.9999999151458066 double var = distribution.Variance; // 4.2044065839577112 // Cumulative distribution functions double cdf = distribution.DistributionFunction(x: 4.2); // 0.7877520261732569 double ccdf = distribution.ComplementaryDistributionFunction(x: 4.2); // 0.21224797382674304 double icdf = distribution.InverseDistributionFunction(p: cdf); // 4.3304819115496436 // Probability density functions double pdf = distribution.ProbabilityDensityFunction(x: 4.2); // 0.21224797382674304 double lpdf = distribution.LogProbabilityDensityFunction(x: 4.2); // -1.55 // Hazard (failure rate) functions double hf = distribution.HazardFunction(x: 4.2); // 1.0 double chf = distribution.CumulativeHazardFunction(x: 4.2); // 1.55 // String representation string str = distribution.ToString(); // H(x; v, t)