({{, (RefLink[DataDistribution, paclet:ref/DataDistribution])[ddist,…] 
represents a probability distribution of type ddist, estimated from a set of data.}})

OpenersNotesSection(Spacer1)Details

(RefLink[DataDistribution, paclet:ref/DataDistribution]) objects are produced by functions such as (RefLink[EmpiricalDistribution, paclet:ref/EmpiricalDistribution]), (RefLink[HistogramDistribution, paclet:ref/HistogramDistribution]), (RefLink[SmoothKernelDistribution, paclet:ref/SmoothKernelDistribution]), (RefLink[KernelMixtureDistribution, paclet:ref/KernelMixtureDistribution]), and (RefLink[SurvivalDistribution, paclet:ref/SurvivalDistribution]).

In standard output format, only the estimation method ddist and the dimensionality of the data are printed.

(RefLink[DataDistribution, paclet:ref/DataDistribution]) can be used with such functions as (RefLink[Mean, paclet:ref/Mean]), (RefLink[CDF, paclet:ref/CDF]), and (RefLink[RandomVariate, paclet:ref/RandomVariate]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Create a univariate (RefLink[DataDistribution, paclet:ref/DataDistribution]):

data=RandomVariate[NormalDistribution[],10];

Using (RefLink[SmoothKernelDistribution, paclet:ref/SmoothKernelDistribution]):

SmoothKernelDistribution[data]

Using (RefLink[HistogramDistribution, paclet:ref/HistogramDistribution]):

HistogramDistribution[data]

Visualize the PDF of a data distribution:

data=RandomVariate[NormalDistribution[],10];

𝒟=SmoothKernelDistribution[data]

Plot[PDF[𝒟,x],{x,-4,4},Frame->True,Filling->Axis]

Visualize the CDF of a data distribution:

𝒟=HistogramDistribution[{-2,-1.5,-0.5,1.1,1.5,2.25}]

Plot[CDF[𝒟,x],{x,-4,6},Frame->True,Filling->Axis,Exclusions->None]

Calculate moments of a data distribution:

𝒟=SmoothKernelDistribution[{-2,-1.5,-0.5,1.1,1.5,2.25}]

(RefLink[Mean, paclet:ref/Mean]):

Mean[𝒟]

(RefLink[Variance, paclet:ref/Variance]):

Variance[𝒟]

OpenersExampleSection1(Spacer1)Scope  (3)

(RefLink[DataDistribution, paclet:ref/DataDistribution]) objects can be created from five data-based distributions:

data=RandomVariate[NormalDistribution[],7];

type={SmoothKernelDistribution,KernelMixtureDistribution,SurvivalDistribution,EmpiricalDistribution,HistogramDistribution};

TableForm[Table[f[data],{f,type}],{1,5}]

Any property that applies to a parametric distribution applies to data distributions:

data=RandomVariate[BetaDistribution[2,3],100];

𝒟 = KernelMixtureDistribution[data];

Generating functions:

MomentGeneratingFunction[𝒟,t]//Short

Random number generation:

Histogram[RandomVariate[𝒟,100]]

Distribution functions:

Plot[HazardFunction[𝒟,x],{x,0,1},Filling->Axis,Frame->True]

Moments:

Moment[𝒟,2]

(RefLink[DataDistribution, paclet:ref/DataDistribution]) created from quantity data retains information about units:

qa=QuantityArray[RandomReal[{10,20},100],"Grams"]

𝒟=EmpiricalDistribution[qa]

Extract distribution of the data magnitude and the unit of the data:

{QuantityMagnitude[𝒟],QuantityUnit[𝒟]}

Find basic moments:

{Mean[𝒟],StandardDeviation[𝒟],Skewness[𝒟],Kurtosis[𝒟]}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[EmpiricalDistribution, paclet:ref/EmpiricalDistribution])  ▪  (RefLink[HistogramDistribution, paclet:ref/HistogramDistribution])  ▪  (RefLink[SmoothKernelDistribution, paclet:ref/SmoothKernelDistribution])  ▪  (RefLink[KernelMixtureDistribution, paclet:ref/KernelMixtureDistribution])  ▪  (RefLink[SurvivalDistribution, paclet:ref/SurvivalDistribution])  ▪  (RefLink[LearnedDistribution, paclet:ref/LearnedDistribution])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Nonparametric Statistical Distributions, paclet:guide/NonparametricStatisticalDistributions])}})}})