SmoothKernelDistribution[{x1,x2,…}]
表示基于数据值 xi 的平滑核分布.
SmoothKernelDistribution[{{x1,y1,…},{x2,y2,…},…}]
表示基于数据值 {xi,yi,…} 的多元平滑核分布.
SmoothKernelDistribution[…,bw]
表示带宽为 bw 的平滑核分布.
SmoothKernelDistribution[…,bw,ker]
表示带宽为 bw 以及平滑核为 ker 的平滑核分布.
SmoothKernelDistribution
SmoothKernelDistribution[{x1,x2,…}]
表示基于数据值 xi 的平滑核分布.
SmoothKernelDistribution[{{x1,y1,…},{x2,y2,…},…}]
表示基于数据值 {xi,yi,…} 的多元平滑核分布.
SmoothKernelDistribution[…,bw]
表示带宽为 bw 的平滑核分布.
SmoothKernelDistribution[…,bw,ker]
表示带宽为 bw 以及平滑核为 ker 的平滑核分布.
更多信息和选项
- SmoothKernelDistribution 返回一个可以像任何其它概率分布一样使用的 DataDistribution 对象.
- 一个值
的 SmoothKernelDistribution 的概率密度函数由平滑核
和带宽参数
的
的线性插值版本给出. - 可以给出如下带宽说明 bw:
-
h 要使用的带宽 {"Standardized",h} 以标准差为单位的带宽 {"Adaptive",h,s} 具有初始带宽 h 和灵敏度 s 的自适应性 Automatic 自动计算的带宽 "name" 使用一个已命名的带宽选择方法 {bwx,bwy,…} 对 x、y 等的不同的带宽说明 - 对于多变量密度,h 可以是正定对称矩阵.
- 对于自适应带宽,敏感度 s 必须是介于 0 和 1 之间的实数或 Automatic. 如果使用 Automatic,s 被设为
,其中
是数据的维数. - 可能的已命名带宽选择方法包括:
-
"LeastSquaresCrossValidation" 使用最小二乘交叉核实法 "Oversmooth" 比标准高斯宽 1.08 倍 "Scott" 使用 Scott 规则来确定带宽 "SheatherJones" 使用 Sheather-Jones 插入式估计量 "Silverman" 使用 Silverman 规则来确定带宽 "StandardDeviation" 使用标准差作为带宽 "StandardGaussian" 标准正态数据的最佳带宽 - 默认使用 "Silverman" 法.
- 对于自动带宽计算,假定常量数组具有单位方差.
- 可以给出的可能的核说明 ker 有:
-
"Biweight" 

"Cosine" 

"Epanechnikov" 

"Gaussian" 

"Rectangular" 

"SemiCircle" 

"Triangular" 

"Triweight" 

func 

- 为了使 SmoothKernelDistribution 能够生成一个真正的密度估计,函数 fn 应该是一个有效的概率密度函数.
- 默认使用 "Gaussian" 核.
- 内核函数 ker 可以使用 {"Bounded",c,ker} 指定来考虑内在密度的已知边界,其中 c 可以是任意实数、列表 {c1,c2} 满足 c1<c2,或者列表 {{c11,c12},{c21,c22},…},其中长度等于 data 的维度.
- 对于多变量密度,核函数 ker 可以分别使用 {"Product",ker} 和 {"Radial",ker} 指定 Product 和 Radial 类型. 如果没有指定类型,则使用 Product 类型核.
- 密度估计所用的精度是在 bw 和数据中给出的最小精度.
- 可以给出以下选项:
-
InterpolationPoints Automatic 所使用的插值点的初始数目 MaxMixtureKernels Automatic 所使用的核的最大数目 MaxRecursion Automatic 所允许的递归细分数目 PerformanceGoal Automatic 对速度或者质量进行优化 MaxExtraBandwidths Automatic 超过要使用的数据的最大带宽 - SmoothKernelDistribution 可以与诸如 Mean、CDF 和 RandomVariate 等函数一起使用.
范例
打开所有单元 关闭所有单元基本范例 (2)
data = RandomVariate[NormalDistribution[], 10 ^ 3];𝒟 = SmoothKernelDistribution[data];Table[Plot[f[𝒟, x], {x, -4, 4}, PlotLabel -> f], {f, {PDF, CDF}}]Moment[𝒟, 2]Quantile[𝒟, 0.95]data = RandomVariate[BinormalDistribution[.75], 10];𝒟 = SmoothKernelDistribution[data];Table[ContourPlot[f[𝒟, {x, y}], {x, -3, 3}, {y, -3, 3}, PlotLabel -> f, PlotRange -> All], {f, {PDF, CDF}}]Covariance[𝒟]//MatrixFormMoment[𝒟, {1, 2}]范围 (37)
基本用途 (7)
data = RandomVariate[NormalDistribution[], 10^4];𝒟 = SmoothKernelDistribution[data];Show[Histogram[data, Automatic, "PDF"], Plot[PDF[𝒟, x], {x, -4, 4}]]Probability[x > 3, x𝒟]data = QuantityArray[RandomVariate[NormalDistribution[1, 2.5], 10 ^ 4], "Meters"]𝒟 = SmoothKernelDistribution[data]#[𝒟]& /@ {Mean, Variance, Skewness, Kurtosis}data = RandomVariate[NormalDistribution[], 5];bw = {.1, .2, .5, 1.0};Table[Plot[PDF[SmoothKernelDistribution[data, i], x]//Evaluate, {x, -4, 4}, PlotLabel -> Row[{"bandwidth = ", i}], PlotRange -> {0, 1.6}, Filling -> Axis], {i, bw}]data = RandomVariate[𝒹 = MixtureDistribution[{1, 2}, {NormalDistribution[], NormalDistribution[2, 1 / 2]}], 10^4];𝒟 = SmoothKernelDistribution[data, {"Adaptive", Automatic, .5}];Plot[{PDF[𝒹, x], PDF[𝒟, x]}, {x, -4, 4}, PlotLegends -> {"𝒹", "𝒟"}]data = RandomVariate[NormalDistribution[], {10, 3}];𝒟 = SmoothKernelDistribution[data, .5];Table[Plot[Evaluate[PDF[MarginalDistribution[𝒟, i], x]], {x, -4, 4}, PlotLabel -> i], {i, {1, 2, 3}}]Table[Plot3D[Evaluate[PDF[MarginalDistribution[𝒟, i], {x, y}]], {x, -4, 4}, {y, -4, 4}, PlotRange -> All, PlotLabel -> i], {i, Subsets[{1, 2, 3}, {2}]}]data = RandomVariate[NormalDistribution[], 100];kerns = {"Gaussian", "Rectangular", "Triangular"};𝒟s = Table[SmoothKernelDistribution[data, Automatic, k], {k, kerns}];MapThread[Plot[PDF[#1, x], {x, -4, 4}, Exclusions -> None, PlotLabel -> #2]&, {𝒟s, kerns}]𝒟custom = SmoothKernelDistribution[data, Automatic, PDF[NormalDistribution[], #]&];Plot[PDF[𝒟custom, x], {x, -4, 4}]data = RandomVariate[BinormalDistribution[2 / 5], 250];kernel = PDF[CauchyDistribution[0, 1], #]&;𝒟 = Table[SmoothKernelDistribution[data, {{1, .25}, {.25, 1}}, k], {k, {{"Radial", kernel}, {"Product", kernel}}}];Table[Plot3D[PDF[i, {x, y}]//Evaluate, {x, -5, 5}, {y, -5, 5}, PlotRange -> All, Exclusions -> None, MeshFunctions -> (#3&)], {i, 𝒟}]分布属性 (8)
𝒟 = SmoothKernelDistribution[RandomVariate[NormalDistribution[], 1000]];Table[Plot[f[𝒟, x], {x, -4, 4}, Filling -> Axis, PlotLabel -> f, Exclusions -> None], {f, {PDF, CDF, HazardFunction, SurvivalFunction}}]𝒟 = SmoothKernelDistribution[RandomReal[NormalDistribution[], 1000]];{Mean[𝒟], Variance[𝒟], Skewness[𝒟], Kurtosis[𝒟]}Table[Moment[𝒟, k], {k, 4}]Table[CentralMoment[𝒟, k], {k, 4}]Table[Cumulant[𝒟, k], {k, 4}]Table[FactorialMoment[𝒟, k], {k, 4}]𝒟 = SmoothKernelDistribution[RandomReal[NormalDistribution[], 1000]];Plot[Quantile[𝒟, p], {p, 0, 1}, Filling -> Axis, Exclusions -> None]Quartiles[𝒟]InterquartileRange[𝒟]Quantile[𝒟, {0.05, 0.95}]Median[𝒟]𝒟 = SmoothKernelDistribution[RandomVariate[NormalDistribution[], 1000]];RandomVariate[𝒟, 10]与 SmoothKernelDistribution 比较:
Show[Histogram[RandomVariate[𝒟, 10^4], Automatic, "PDF"],
Plot[PDF[𝒟, x], {x, -4, 4}]]data = RandomReal[NormalDistribution[], 1000];𝒟 = SmoothKernelDistribution[data];NProbability[x > 2, x𝒟]NExpectation[x ^ 2 + 3x + 5, x𝒟]𝒟 = SmoothKernelDistribution[RandomVariate[BinormalDistribution[.75], 100]];Table[DiscretePlot3D[Evaluate[f[𝒟, {x, y}]], {x, -4, 4, .5}, {y, -4, 4, .5}, PlotLabel -> f,
ExtentSize -> 1 / 2], {f, {PDF, CDF, HazardFunction, SurvivalFunction}}]𝒟 = SmoothKernelDistribution[RandomReal[BinormalDistribution[.75], 1000]];{Mean[𝒟], Variance[𝒟]}Covariance[𝒟]//MatrixFormCorrelation[𝒟]//MatrixFormMoment[𝒟, {1, 2}]CentralMoment[𝒟, {1, 2}]Cumulant[𝒟, {1, 2}]FactorialMoment[𝒟, {1, 2}]𝒟 = SmoothKernelDistribution[RandomReal[BinormalDistribution[.5], 10 ^ 2]];RandomVariate[𝒟, 6]ListPlot[RandomVariate[𝒟, 10^4], PlotRange -> {{-4, 4}, {-4, 4}}]带宽选择 (12)
data1 = RandomVariate[𝒹 = NormalDistribution[], 10];
data2 = RandomVariate[𝒹, 10 ^ 4];𝒟1 = SmoothKernelDistribution[data1];
𝒟2 = SmoothKernelDistribution[data2];Table[Plot[{PDF[𝒟, x], PDF[𝒹, x]}, {x, -4, 4}, Filling -> Axis, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[NormalDistribution[], 10 ^ 3];𝒟1 = SmoothKernelDistribution[data, 0.1];
𝒟2 = SmoothKernelDistribution[data, 1.0];Table[Plot[PDF[𝒟, x], {x, -4, 4}, Filling -> Axis, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[NormalDistribution[], 10 ^ 3];𝒟1 = SmoothKernelDistribution[data, {"Standardized", 1 / 2}];
𝒟2 = SmoothKernelDistribution[data, {"Standardized", 1 / 8}];Table[Plot[PDF[𝒟, x], {x, -4, 4}, Filling -> Axis, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[NormalDistribution[], 10 ^ 3];Table[Plot[Evaluate[PDF[SmoothKernelDistribution[data, {"Adaptive", Automatic, s}], x]], {x, -4, 4}, PlotLabel -> Row[{"s = ", s}]], {s, {0, .25, .75, 1}}]data = RandomVariate[NormalDistribution[], 10 ^ 3];𝒟1 = SmoothKernelDistribution[data, {"Adaptive", 1.0, .5}];
𝒟2 = SmoothKernelDistribution[data, {"Adaptive", 0.1, .5}];Table[Plot[PDF[𝒟, x], {x, -4, 4}, Filling -> Axis, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[NormalDistribution[], 100];Table[Plot[Evaluate[PDF[SmoothKernelDistribution[data, name], x]], {x, -4, 4}, Filling -> Axis, Exclusions -> None, PlotLabel -> name], {name, {"LeastSquaresCrossValidation", "Oversmooth", "Scott", "SheatherJones", "StandardDeviation", "StandardGaussian"}}]data = RandomVariate[NormalDistribution[], 10 ^ 3];𝒟1 = SmoothKernelDistribution[data, "Silverman"];
𝒟2 = SmoothKernelDistribution[data, Automatic];Table[Plot[PDF[𝒟, x], {x, -4, 4}, Filling -> Axis, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]默认情况下,使用 Silverman 方法在每一方向上独立选择带宽:
data = RandomVariate[BinormalDistribution[.75], 25];Table[Plot3D[Evaluate[PDF[SmoothKernelDistribution[data, name], {x, y}]], {x, -3, 3}, {y, -3, 3}, PlotRange -> All, PlotLabel -> name, Exclusions -> None], {name, {Automatic, "Silverman"}}]data = RandomVariate[BinormalDistribution[.75], 25];Table[Plot3D[Evaluate[PDF[SmoothKernelDistribution[data, name], {x, y}]], {x, -3, 3}, {y, -3, 3}, PlotRange -> All, PlotLabel -> name, Exclusions -> None], {name, {"LeastSquaresCrossValidation", "Oversmooth", "Scott", "SheatherJones", "StandardDeviation", "StandardGaussian"}}]BlockRandom[SeedRandom[6];data = RandomVariate[NormalDistribution[], {10, 3}]];𝒟 = SmoothKernelDistribution[data, {{"Adaptive", .05, 1}, "Silverman", 2}];Table[Plot[Evaluate[PDF[MarginalDistribution[𝒟, i], x]], {x, -4, 4}, PlotRange -> All, PlotLabel -> i], {i, {1, 2, 3}}]data = RandomVariate[BinormalDistribution[.75], 25];bands = {.25, .5, 1.0};Table[Plot3D[Evaluate[PDF[SmoothKernelDistribution[data, bw], {x, y}]], {x, -3, 3}, {y, -3, 3}, PlotRange -> All, PlotLabel -> Row[{"bandwidth = ", bw * IdentityMatrix[2]}], Exclusions -> None], {bw, bands}]bw = {{1 / 2, 1 / 4}, {1 / 4, 1 / 2}};𝒟 = SmoothKernelDistribution[RandomVariate[NormalDistribution[], {100, 2}], bw];ContourPlot[Evaluate[PDF[𝒟, {x, y}]], {x, -3, 3}, {y, -3, 3}, PlotRange -> All]核函数 (6)
data = RandomVariate[NormalDistribution[], 100];Table[Plot[Evaluate[PDF[SmoothKernelDistribution[data, Automatic, i], x]], {x, -4, 4}, Filling -> Axis, Ticks -> None, PlotLabel -> i, Exclusions -> None], {i, {"Biweight", "Cosine", "Epanechnikov", "Gaussian", "Rectangular", "SemiCircle", "Triangular", "Triweight"}}]data = RandomVariate[NormalDistribution[], 10];𝒟1 = SmoothKernelDistribution[data, Automatic];
𝒟2 = SmoothKernelDistribution[data, Automatic, (1/π (1 + #1^2))&];Table[Plot[Evaluate[PDF[𝒟, x]], {x, -4, 4}, Filling -> Axis, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[NormalDistribution[], 10];𝒟1 = SmoothKernelDistribution[data, Automatic];
𝒟2 = SmoothKernelDistribution[data, Automatic, "Gaussian"];Table[Plot[Evaluate[PDF[𝒟, x]], {x, -4, 4}, Filling -> Axis, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]这等同于使用 NormalDistribution[0,1] 的概率密度函数:
𝒟3 = SmoothKernelDistribution[data, Automatic, PDF[NormalDistribution[], #]&];Plot[PDF[𝒟3, x], {x, -4, 4}, Filling -> Axis, Exclusions -> None]kernels = {"Biweight", "Cosine", "Epanechnikov", "Gaussian", "Rectangular", "SemiCircle", "Triangular", "Custom"};dists = Table[SmoothKernelDistribution[{0}, 1, i], {i, (kernels /. {"Custom" -> (PDF[CauchyDistribution[0, 1], #]&)})}];Table[Plot[Evaluate[PDF[dists[[i]], x]], {x, -3, 3}, PlotRange -> All, PlotLabel -> kernels[[i]], Filling -> Axis, Ticks -> None], {i, Length[kernels]}]data = RandomVariate[BinormalDistribution[.75], 10];Table[Plot3D[Evaluate[PDF[SmoothKernelDistribution[data, Automatic, i], {x, y}]], {x, -4, 4}, {y, -4, 4}, Ticks -> None, PlotLabel -> i, PlotRange -> All, MeshFunctions -> (#3&)], {i, {"Biweight", "Cosine", "Epanechnikov", "Gaussian", "Rectangular", "SemiCircle", "Triangular", "Triweight"}}]data = {{0, 0}};kerns = {{"Product", "Biweight"}, {"Radial", "Biweight"}};Table[Plot3D[Evaluate[PDF[ SmoothKernelDistribution[data, 1, i], {x, y}]], {x, -1.5, 1.5}, {y, -1.5, 1.5}, Ticks -> None, PlotLabel -> i, PlotRange -> All, MeshFunctions -> (#3 &), Boxed -> False], {i, kerns}]使用固定域估计 (4)
data = RandomVariate[BetaDistribution[2, 3], 10 ^ 4];𝒟1 = SmoothKernelDistribution[data, Automatic, "Gaussian"];Plot[PDF[𝒟1, x]//Evaluate, {x, -0.1, 1.1}]𝒟2 = SmoothKernelDistribution[data, Automatic, {"Bounded", {0, 1}, "Gaussian"}];Plot[PDF[𝒟2, x]//Evaluate, {x, -.1, 1.1}]与原始 BetaDistribution 比较:
Plot[{PDF[𝒟2, x], PDF[BetaDistribution[2, 3], x]}//Evaluate, {x, -.1, 1.1}, PlotLegends -> {"Bounded smooth kernel density estimate", "Beta distribution density"}]sample = RandomReal[{-8, 8}, 512];skd[c_] := SmoothKernelDistribution[sample, .25, {"Bounded", {-c, c}, "Epanechnikov"}]Table[Plot[Evaluate[PDF[skd[c], x]], {x, -10, 10}, Filling -> Axis, PlotRange -> {0, .2}, PlotLabel -> {-c, c}], {c, {∞, 8}}]QuantilePlot[{skd[Infinity], skd[8]}, UniformDistribution[{-8, 8}], PlotRange -> {{-8.5, -5}, {-8.5, -5}}, PlotLegends -> {"Unbounded", "Bounded to (-8,8)"}]cpd = CopulaDistribution[{"Binormal", .75}, {TriangularDistribution[{0, 1}], WignerSemicircleDistribution[1]}];data = RandomVariate[cpd, 10 ^ 4];skd = SmoothKernelDistribution[data, .2, {"Bounded", {{0, 1}, {-1, 1}}, "Cosine"}]Table[Plot3D[pdf, {x, -0.5, 1.5}, {y, -1.5, 1.5}, PlotRange -> All, AxesLabel -> Automatic, ImageSize -> 220, PlotTheme -> "CoolColors", Exclusions -> {{(1 - y ^ 2), 0 < x < 1}, {x(1 - x) == 0, -1 < y < 1}}], {pdf, {PDF[skd, {x, y}], PDF[cpd, {x, y}]}}]data = RandomReal[{-3, 5}, 10 ^ 3];𝒟 = SmoothKernelDistribution[data, .5, {"Bounded", {-3, 5}, "Gaussian"}];𝒟2 = TruncatedDistribution[{-3, 5}, SmoothKernelDistribution[data, .5, "Gaussian"]];Plot[{PDF[𝒟, x], PDF[𝒟2, x]}//Evaluate, {x, -4, 6}, PlotLegends -> {"Bounded", "Truncated"}]选项 (25)
InterpolationPoints (6)
data = RandomVariate[𝒹 = CauchyDistribution[0, 1], 10 ^ 3];𝒟 = SmoothKernelDistribution[data, InterpolationPoints -> Automatic];Plot[{PDF[𝒟, x], PDF[𝒹, x]}, {x, -10, 10}, PlotRange -> All, PlotLegends -> {"𝒟", "𝒹"}]data = RandomVariate[NormalDistribution[], 10];𝒟 = SmoothKernelDistribution[data, InterpolationPoints -> 4];Plot[PDF[𝒟, x], {x, -6, 6}, Filling -> Axis, PlotRange -> All]data = RandomVariate[NormalDistribution[], 10];estimates = Table[SmoothKernelDistribution[data, InterpolationPoints -> i, MaxRecursion -> 3], {i, {2, 4, 6, 8}}];Table[Plot[PDF[i, x], {x, -4, 4}, Filling -> Axis], {i, estimates}]data = RandomVariate[BinormalDistribution[.8], 100];estimates = Table[SmoothKernelDistribution[data, InterpolationPoints -> i], {i, {5, 50}}];Table[ContourPlot[PDF[i, {x, y}]//Evaluate, {x, -3, 3}, {y, -3, 3}, PlotRange -> All], {i, estimates}]data = RandomVariate[BinormalDistribution[.8], 100];estimates = Table[SmoothKernelDistribution[data, InterpolationPoints -> i, MaxRecursion -> 3], {i, {{3, 30}, {30, 3}}}];Table[ContourPlot[PDF[i, {x, y}]//Evaluate, {x, -4, 4}, {y, -4, 4}, PlotRange -> All], {i, estimates}]𝒟h = HistogramDistribution[RandomVariate[NormalDistribution[], 100], 5];在这种情况下,使用1000个插值点创建了一个非平滑的估计量:
𝒟s = SmoothKernelDistribution[RandomVariate[𝒟h, 100], InterpolationPoints -> 1000];Plot[{PDF[𝒟s, x], PDF[𝒟h, x]}, {x, -4, 4}, PlotRange -> All, Exclusions -> None, PlotLegends -> {"𝒟s", "𝒟h"}]MaxExtraBandwidths (6)
data = RandomVariate[𝒹 = ParetoDistribution[1, 2], 10 ^ 3];𝒟1 = SmoothKernelDistribution[data, MaxExtraBandwidths -> 12];
𝒟2 = SmoothKernelDistribution[data, MaxExtraBandwidths -> Automatic];Table[Plot[PDF[𝒟, x], {x, 0, 10}, PlotRange -> All], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[𝒹 = ParetoDistribution[1, 2], 10 ^ 3];𝒟1 = SmoothKernelDistribution[data, MaxExtraBandwidths -> 0];
𝒟2 = SmoothKernelDistribution[data, MaxExtraBandwidths -> 12];Table[Plot[PDF[𝒟, x], {x, 0, 10}, PlotRange -> All, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[NormalDistribution[], 10];mebw = {{0, 0}, {0, 12}, {12, 0}, {12, 12}};𝒟 = Table[SmoothKernelDistribution[data, MaxExtraBandwidths -> i],
{i, mebw}];Table[Plot[PDF[𝒟[[i]], x], {x, -6, 6}, PlotRange -> All, Filling -> Axis, PlotLabel -> mebw[[i]], Ticks -> None], {i, 4}]data = RandomVariate[BinormalDistribution[.5], 10];𝒟1 = SmoothKernelDistribution[data, MaxExtraBandwidths -> 0];
𝒟2 = SmoothKernelDistribution[data, MaxExtraBandwidths -> 12];Table[ContourPlot[PDF[𝒟, {x, y}], {x, -4, 4}, {y, -4, 4}, PlotRange -> All, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[BinormalDistribution[.5], 10];𝒟1 = SmoothKernelDistribution[data, MaxExtraBandwidths -> {0, 12}];
𝒟2 = SmoothKernelDistribution[data, MaxExtraBandwidths -> {12, 0}];Table[ContourPlot[PDF[𝒟, {x, y}], {x, -4, 4}, {y, -4, 4}, PlotRange -> All, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]data = RandomVariate[BinormalDistribution[.5], 10];𝒟1 = SmoothKernelDistribution[data, MaxExtraBandwidths -> {{0, 12}, {12, 0}}];
𝒟2 = SmoothKernelDistribution[data, MaxExtraBandwidths -> {{12, 0}, {0, 12}}];Table[ContourPlot[PDF[𝒟, {x, y}], {x, -4, 4}, {y, -4, 4}, PlotRange -> All, Exclusions -> None], {𝒟, {𝒟1, 𝒟2}}]MaxMixtureKernels (6)
data = RandomVariate[𝒹 = ParetoDistribution[1, 2], 10 ^ 4];𝒟 = SmoothKernelDistribution[data, MaxMixtureKernels -> Automatic];Plot[{PDF[𝒟, x], PDF[𝒹, x]}, {x, 0, 6}, PlotRange -> {0, 1.3}, PlotLegends -> {"𝒟", "𝒹"}]data = RandomVariate[NormalDistribution[], 10];𝒟 = SmoothKernelDistribution[data, MaxMixtureKernels -> 5];Plot[PDF[𝒟, x], {x, -4, 4}, Filling -> Axis, PlotRange -> All]data = RandomVariate[NormalDistribution[], 10 ^ 4];estimates = Table[SmoothKernelDistribution[data, MaxMixtureKernels -> i], {i, {10, 15, 25, 100}}];Table[Plot[{PDF[i, x], PDF[NormalDistribution[], x]}, {x, -4, 4}, Filling -> Axis, PlotRange -> All], {i, estimates}]data = {-2, 0, 2};𝒟 = SmoothKernelDistribution[data, .25, MaxMixtureKernels -> All];Plot[PDF[𝒟, x], {x, -4, 4}, Filling -> Axis]Table[Plot[PDF[SmoothKernelDistribution[data, bw, MaxMixtureKernels -> All], x]//Evaluate, {x, -4, 4}, Filling -> Axis, PlotRange -> {0, .6}, PlotLabel -> Row[{"bandwidth = ", bw}]], {bw, {0.25, 0.5, 0.75, 1.0}}]data = RandomVariate[BinormalDistribution[.8], 100];estimates = Table[SmoothKernelDistribution[data, .2, MaxMixtureKernels -> i], {i, {10, 100}}];Table[DensityPlot[PDF[i, {x, y}]//Evaluate, {x, -4, 4}, {y, -4, 4}, PlotPoints -> 100, PlotRange -> All, ColorFunction -> "TemperatureMap"], {i, estimates}]data = RandomVariate[BinormalDistribution[.8], 100];estimates = Table[SmoothKernelDistribution[data, MaxMixtureKernels -> i], {i, {{5, 50}, {50, 5}}}];Table[Plot3D[Evaluate[PDF[i, {x, y}]], {x, -4, 4}, {y, -4, 4}, PlotPoints -> 50, PlotRange -> All], {i, estimates}]MaxRecursion (4)
data = RandomVariate[𝒹 = NormalDistribution[], 10 ^ 3];𝒟 = SmoothKernelDistribution[data, MaxRecursion -> Automatic];Plot[{PDF[𝒟, x], PDF[𝒹, x]}, {x, -5, 5}, PlotLegends -> {"𝒟", "𝒹"}]data = RandomVariate[NormalDistribution[], 10];𝒟 = Table[SmoothKernelDistribution[data, InterpolationPoints -> 3, MaxRecursion -> i], {i, {0, 2, 4, 6}}];Table[Plot[PDF[i, x], {x, -5, 5}, Filling -> Axis, PlotRange -> All], {i, 𝒟}]data = RandomVariate[BinormalDistribution[.8], 100];estimates = Table[SmoothKernelDistribution[data, MaxRecursion -> i, InterpolationPoints -> 3], {i, {2, 6}}];Table[Plot3D[PDF[i, {x, y}]//Evaluate, {x, -4, 4}, {y, -4, 4}, PlotRange -> All, ColorFunction -> "TemperatureMap"], {i, estimates}]data = RandomVariate[BinormalDistribution[.8], 100];estimates = Table[SmoothKernelDistribution[data, MaxRecursion -> i, InterpolationPoints -> 6], {i, {{0, 3}, {3, 0}}}];Table[Plot3D[PDF[i, {x, y}]//Evaluate, {x, -4, 4}, {y, -4, 4}, PlotRange -> All], {i, estimates}]PerformanceGoal (3)
data = RandomVariate[𝒹 = NormalDistribution[], 10 ^ 5];(𝒟 = SmoothKernelDistribution[data, PerformanceGoal -> Automatic])//TimingPlot[{PDF[𝒟, x], PDF[𝒹, x]}, {x, -5, 5}, PlotLegends -> {"𝒟", "𝒹"}]对速度或者质量,设置 PerformanceGoal,或使用 Automatic 平衡两者:
data = RandomVariate[𝒹 = MixtureDistribution[{1, 1}, {MultinormalDistribution[{-1, -1}, IdentityMatrix[2]], MultinormalDistribution[{1, 1}, .5IdentityMatrix[2]]}], 10 ^ 2];在 PerformanceGoal 设置为 "Quality" 时,需要更多时间:
𝒟1 = SmoothKernelDistribution[data, PerformanceGoal -> "Speed"];//Timing𝒟2 = SmoothKernelDistribution[data, PerformanceGoal -> Automatic];//Timing𝒟3 = SmoothKernelDistribution[data, PerformanceGoal -> "Quality"];//TimingTable[ContourPlot[Evaluate[PDF[𝒟, {x, y}]], {x, -4, 4}, {y, -4, 4}, PlotPoints -> 35, PlotRange -> All], {𝒟, {𝒟1, 𝒟2, 𝒟3}}]使用 ControlActive 动态变化 PerformanceGoal:
data = RandomVariate[MixtureDistribution[{1 / 2, 1 / 10, 1 / 10, 1 / 10, 1 / 10, 1 / 10}, Join[{NormalDistribution[]}, Table[NormalDistribution[i / 2 - 1, 1 / 10], {i, 0, 4}]]], 3 * 10 ^ 3];Manipulate[Plot[PDF[SmoothKernelDistribution[data, PerformanceGoal -> ControlActive["Speed", "Quality"]], x]//Evaluate, {x, a, b}, PlotRange -> {Automatic, {0, .55}}], {a, -3, 0.1}, {b, 3, 0, -.1}, SaveDefinitions -> True]应用 (14)
𝒹 = MixtureDistribution[{1 / 2, 1 / 10, 1 / 10, 1 / 10, 1 / 10, 1 / 10}, Join[{NormalDistribution[]}, Table[NormalDistribution[i / 2 - 1, 1 / 10], {i, 0, 4}]]];data = RandomVariate[𝒹, 10 ^ 5];𝒟 = SmoothKernelDistribution[data, {"Adaptive", Automatic, .25}, PerformanceGoal -> "Quality"];Plot[{PDF[𝒟, x], PDF[𝒹, x]}, {x, -4, 4}, PlotLegends -> {"𝒟", "𝒹"}]{Mean[𝒹], Variance[𝒹], Skewness[𝒹], Kurtosis[𝒹]}//N{Mean[𝒟], Variance[𝒟], Skewness[𝒟], Kurtosis[𝒟]}使用 TruncatedDistribution 来限制平滑后的域:
data = RandomVariate[ExponentialDistribution[2], 10 ^ 4];dist = SmoothKernelDistribution[data];𝒟 = TruncatedDistribution[{0, Infinity}, dist];Plot[PDF[𝒟, x]//Evaluate, {x, -1, 5}, PlotRange -> All, Filling -> Axis]NProbability[x < 0, x𝒟]使用 Cases 来限制平滑前的数据域:
data = Cases[RandomVariate[NormalDistribution[], 10 ^ 5], x_ /; x > 0];𝒟 = SmoothKernelDistribution[data];Plot[PDF[𝒟, x], {x, -1, 5}, PlotRange -> All, Filling -> Axis]NProbability[x < 0, x𝒟]使用 MaxExtraBandwidths 无需删除数据来限制域:
data = RandomVariate[ExponentialDistribution[2], 10 ^ 6];𝒟 = SmoothKernelDistribution[data, MaxExtraBandwidths -> {0, 12}];Plot[PDF[𝒟, x], {x, -3, 3}, PlotRange -> All, Filling -> Axis]NProbability[x < 0, x𝒟]𝒟 = SmoothKernelDistribution[ N[Log[Table[GenomeData[i, "SequenceLength"], {i, 41}] ]]];Plot[PDF[𝒟, x], {x, 0, 30}, Filling -> Axis, Frame -> True]NExpectation[xx > Mean[𝒟], x𝒟]data = Table[Prime[i] - Prime[i - 1], {i, 2, 10 ^ 4}];𝒟 = SmoothKernelDistribution[data];Plot[PDF[𝒟, x], {x, -10, 50}, Filling -> Axis, Frame -> True, PlotRange -> All, Axes -> False]NExpectation[13 + x, x𝒟]sp500 = ExampleData[{"Statistics", "SP500"}];Subscript[𝒟, SP500] = SmoothKernelDistribution[sp500, {"Adaptive", Automatic, .25}];dfit = EstimatedDistribution[sp500, LaplaceDistribution[μ, β]];Plot[{PDF[dfit, x], PDF[Subscript[𝒟, SP500], x]}, {x, -5, 5}, PlotRange -> All, AxesOrigin -> {-5, 0}, PlotLegends -> {"dfit", "SubscriptBox[𝒟, SP500]"}]ExampleData[{"Statistics", "UniversitySalaries"}, "ColumnDescriptions"]fullData = ExampleData[{"Statistics", "UniversitySalaries"}][[All, {1, 3}]];statSalaries = Cases[fullData, {"Statistics", salary_} :> salary];
chemSalaries = Cases[fullData, {"Chemistry", salary_} :> salary];Subscript[𝒟, Stat] = SmoothKernelDistribution[QuantityArray[statSalaries, "USDollars"]];
Subscript[𝒟, Chem] = SmoothKernelDistribution[QuantityArray[chemSalaries, "USDollars"]];Table[Plot[PDF[𝒟, Quantity[x, "USDollars"]], {x, 0, 250000}, Ticks -> {{{70000, "70K"}, {125000, "125K"}, {200000, "200K"}}, None}, PlotRange -> All, Filling -> Axis, AxesLabel -> {"$"}], {𝒟, {Subscript[𝒟, Stat], Subscript[𝒟, Chem]}}]估计 Old Faithful 喷泉持续时间和等待时间的联合分布:
oldF = QuantityArray[ExampleData[{"Statistics", "OldFaithful"}], "Minutes"];Subscript[𝒟, OldF] = SmoothKernelDistribution[oldF, "SheatherJones"];Plot3D[PDF[Subscript[𝒟, OldF], Quantity[{x, y}, "Minutes"]]//Evaluate, {x, 1, 6}, {y, 35, 105}, PlotRange -> All, Exclusions -> None, AspectRatio -> 1, PlotPoints -> 50, AxesLabel -> {"Duration", "Waiting", None}]NProbability[x > Quantity[2, "Minutes"] && y < Quantity[60, "Minutes"], {x, y}Subscript[𝒟, OldF], PrecisionGoal -> 3]data = RandomVariate[NormalDistribution[], 10 ^ 4];hist = HistogramDistribution[data];samples = RandomVariate[hist, 10 ^ 5];{DiscretePlot[PDF[hist, x], {x, -4, 4, .05}], Plot[PDF[SmoothKernelDistribution[samples, "Oversmooth"], x]//Evaluate, {x, -4, 4}, Filling -> Axis]}平滑由 SurvivalDistribution 返回一个估计量:
data = RandomInteger[{10, 40}, 50];censoring = RandomInteger[{0, 1}, 50];𝒟 = SurvivalDistribution[EventData[data, censoring]];samples = RandomVariate[𝒟, 10 ^ 4];Show[DiscretePlot[SurvivalFunction[𝒟, x], {x, data}], Plot[SurvivalFunction[𝒹 = SmoothKernelDistribution[samples], x]//Evaluate, {x, 0, 50}, PlotStyle -> RGBColor[0.87058837853668, 0.6048248459110492, 0.4922838688297661], PlotRange -> All], PlotRange -> {{5, 45}, All}, Axes -> False, Frame -> True]NProbability[x > 25x > 10, x𝒹]ExampleData[{"Statistics", "BuffaloSnow"}, "Description"]data = QuantityArray[ExampleData[{"Statistics", "BuffaloSnow"}]//N, "Inches"];𝒟 = SmoothKernelDistribution[data];bSamp = RandomChoice[Normal[data], {250, Length[data]}];在每个经过自举法处理(bootstrapped)的样本上,进行平滑处理,并且获取置信估计量:
Subscript[𝒟, B] = SmoothKernelDistribution[#]& /@ bSamp;rng = Range[10., 150];
pdf = Table[PDF[i, Quantity[rng, "Inches"]], {i, Subscript[𝒟, B]}];
High = Table[Quantile[i, .975], {i, Transpose[pdf]}];
Low = Table[Quantile[i, .025], {i, Transpose[pdf]}];Show[Plot[PDF[𝒟, Quantity[x, "Inches"]], {x, 0, 150}, PlotRange -> All, AxesLabel -> {"in"}], ListLinePlot[{Transpose[{rng, High}], Transpose[{rng, Low}]}, PlotStyle -> {{Dashed, Gray}}, Filling -> {1 -> {2}}]]给定 p 维多变量正态数据下,确认 Mahalanobis 距离遵从一个渐进的 ChiSquareDistribution[p]:
data = Table[RandomVariate[MultinormalDistribution[ConstantArray[0, i], IdentityMatrix[i]], 10^3], {i, rng = Range[2, 5]}];MahalanobisDistance[data_] := Block[{m = Mean[data], cov = Inverse[Covariance[data]], temp}, temp = (#1 - m&) /@ data;Diagonal[temp.cov.Transpose[temp]]]𝒟s = Table[SmoothKernelDistribution[MahalanobisDistance[i]], {i, data}];Table[Plot[{PDF[ChiSquareDistribution[rng[[i]]], x], PDF[𝒟s[[i]], x]}, {x, 0, 30}, PlotRange -> All, PlotLabel -> Row[{"Dimension: ", rng[[i]]}]], {i, Length[rng]}]给定四维正态数据的情况下,Mahalanobis 距离超过10的概率:
NProbability[x > 10, x𝒟s[[3]]]data = BlockRandom[SeedRandom[11];RandomVariate[𝒹 = CauchyDistribution[0, .1], 10 ^ 3]];Show[SmoothHistogram[data, PlotRange -> All], Plot[PDF[𝒹, x], {x, -10, 10}, PlotStyle -> {Dashed, RGBColor[0.87058837853668, 0.6048248459110492, 0.4922838688297661]}, PlotRange -> All], PlotRange -> {{-10, 10}, {0, .2}}]q10 = Quantile[data, .1];q90 = Quantile[data, .9];left = EstimatedDistribution[Select[data, # < q10&], TruncatedDistribution[{-∞, q10}, CauchyDistribution[a, b]]];right = EstimatedDistribution[Select[data, # > q90&], TruncatedDistribution[{q90, ∞}, CauchyDistribution[a, b]]];body = TruncatedDistribution[{q10, q90}, SmoothKernelDistribution[Select[data, q10 - 1 ≤ # ≤ q90 + 1&]]];𝒟 = MixtureDistribution[{.1, .8, .1}, {left, body, right}];Plot[{PDF[𝒟, x], PDF[𝒹, x]}, {x, -20, 20}, PlotStyle -> {Automatic, {Dashed, RGBColor[0.87058837853668, 0.6048248459110492, 0.4922838688297661]}}, Exclusions -> None, PlotRange -> {0, .2}, PlotLegends -> {"𝒟", "𝒹"}]属性和关系 (9)
SmoothKernelDistribution 的基本属性包括:
dist = SmoothKernelDistribution[{1, 1, 2, 6, 5, 3, 2}];dist["Properties"]Map[# -> Short[dist[#]]&, dist["Properties"]]//Columndata = RandomVariate[NormalDistribution[], 100];𝒟 = SmoothKernelDistribution[data];Integrate[PDF[𝒟, x], {x, -Infinity, Infinity}]data = Range[10];𝒟 = SmoothKernelDistribution[data, 1];Precision[𝒟]data = N[Range[10], 100];𝒟 = SmoothKernelDistribution[data, 1];Precision[𝒟]𝒟 = SmoothKernelDistribution[RandomVariate[NormalDistribution[], 100], InterpolationPoints -> 20, MaxRecursion -> 0];Plot[PDF[𝒟, x], {x, -4, 4}]CDF 和 SurvivalFunction 是分段二次的:
{Plot[CDF[𝒟, x], {x, -4, 4}], Plot[SurvivalFunction[𝒟, x], {x, -4, 4}]}在二次上线性的情况下,HazardFunction 是有理分段的:
Plot[HazardFunction[𝒟, x], {x, -4, 4}]SmoothKernelDistribution 是内在分布的一个一致的估计量:
data = Table[RandomVariate[NormalDistribution[], 10^i], {i, Range[4]}];𝒟l = Table[SmoothKernelDistribution[i], {i, data}];Table[Plot[{PDF[𝒟l[[i]], x], PDF[NormalDistribution[], x]}, {x, -5, 5}, PlotRange -> All, Exclusions -> None, PlotLabel -> Row[{"n=", Superscript[10, i]}]], {i, Range[4]}]data = {-.5, 0, .5};𝒦 = {"Gaussian", "Epanechnikov", "Biweight", "Triweight", "Rectangular", "Triangular", "Cosine", "SemiCircle"};Table[Plot[PDF[SmoothKernelDistribution[data, 200, i], x]//Evaluate, {x, -500, 500}, PlotRange -> All, Ticks -> None, AxesOrigin -> {0, 0}, PlotLabel -> i], {i, 𝒦}]SmoothKernelDistribution 是 KernelMixtureDistribution 的一个线性插值:
data = {-1.5, -1.0, -.2, -.1, 0., 1.5};pts = Table[{i, PDF[KernelMixtureDistribution[data], i]}, {i, Range[-4, 4, .1]}];{ListLinePlot[pts], Plot[PDF[SmoothKernelDistribution[data], x]//Evaluate, {x, -4, 4}]}SmoothKernelDistribution 只在输入为 TimeSeries 或 EventSeries 时才作用于数值:
ts = TemporalData[TimeSeries, {{{1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1,
0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0,
0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0,
1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1}}, {{0, 99, 1}}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, False, 10.1];SmoothKernelDistribution[ts]SmoothKernelDistribution[ts["Values"]]% == %%SmoothKernelDistribution 当输入是 TemporalData 时作用于所有数值:
td = TemporalData[«4»];SmoothKernelDistribution[td]SmoothKernelDistribution[td["ValueList"]//Flatten]%% == %可能存在的问题 (4)
data = {-1.5, -1.0, -.2, -.1, 0., 1.5};𝒟 = SmoothKernelDistribution[data, 1, Cos[#]&];Plot[PDF[𝒟, x], {x, -4, 4}, Filling -> Axis]data = RandomVariate[NormalDistribution[], 10 ^ 6];dist = SmoothKernelDistribution[data, {"Adaptive", Automatic, 1}];Plot[PDF[dist, x]//Evaluate, {x, -4, 4}, PlotRange -> All]尝试增加初始带宽,MaxMixtureKernels,或者降低灵敏度:
dist2 = SmoothKernelDistribution[data, {"Adaptive", 1.5, 1}];Plot[PDF[dist2, x]//Evaluate, {x, -4, 4}, PlotRange -> All]SmoothKernelDistribution 并不知道内在分布的域:
data = RandomVariate[𝒹 = BinomialDistribution[30, .5], 10 ^ 4];{DiscretePlot[PDF[𝒹, x], {x, 5, 25}], Plot[PDF[SmoothKernelDistribution[data], x]//Evaluate, {x, 5, 25}]}data2 = RandomVariate[𝒹2 = TruncatedDistribution[{-1, 1}, NormalDistribution[]], 10 ^ 4];{Plot[PDF[𝒹2, x], {x, -2, 2}, Exclusions -> None], Plot[PDF[SmoothKernelDistribution[data2], x]//Evaluate, {x, -2, 2}]}data3 = RandomVariate[𝒹, 10 ^ 4];
data4 = RandomVariate[𝒹2, 10 ^ 4];{Plot[PDF[SmoothKernelDistribution[data3, {"Adaptive", Automatic, 1}], x]//Evaluate, {x, 5, 25}, PlotRange -> All],
Plot[PDF[SmoothKernelDistribution[data4, {"Adaptive", Automatic, 1}], x]//Evaluate, {x, -2, 2}]}SeedRandom[1];data = RandomVariate[𝒹 = StableDistribution[0, 1 / 9, 1 / 15, 1 / 15, 1], 10 ^ 3];𝒟 = SmoothKernelDistribution[data, 10 ^ -5];{Plot[PDF[𝒹, x], {x, .054, .056}, PlotRange -> All], Plot[PDF[𝒟, x], {x, .054, .056}, PlotRange -> All, Exclusions -> None]}KernelMixtureDistribution 使用不依赖于插值的符号式方法:
𝒟 = KernelMixtureDistribution[data, 10 ^ -5, MaxMixtureKernels -> All]//Quiet;{Plot[PDF[𝒹, x], {x, .054, .056}, PlotRange -> All], Plot[PDF[𝒟, x], {x, .054, .056}, PlotRange -> All, Exclusions -> None]}巧妙范例 (2)
data = WeatherData[loc = FindGeoLocation[], "Temperature", {{2001, 1, 1}, {2009, 1, 1}}, "NonMetricValue"];data = Extract[data, Position[data, x_ /; NumericQ[x]]];𝒟 = SmoothKernelDistribution[data]Show[Plot[PDF[𝒟, x], {x, -10, 110}, Frame -> True, Filling -> Axis, PlotLabel -> Row[{"Temperature Distribution: Lat ", Latitude[loc], " Lon ", Longitude[loc]}], FrameLabel -> {"°F", "Density"}, Axes -> False, PlotRange -> All, ColorFunction -> Function[{x, y}, ColorData["TemperatureMap"][x]]], Plot[PDF[𝒟, x], {x, -10, 110}, PlotStyle -> StandardGray]]dat = ExampleData[{"Statistics", "UgandaVolcanoes"}];
poly = ExampleData[{"Statistics", "WesternUgandaBorder"}];𝒟 = SmoothKernelDistribution[dat, "SheatherJones"];inPolyQ = Compile[{{poly, _Real, 2}, {x, _Real}, {y, _Real}}, Block[{Xi, Yi, Xip1, Yip1, u, v, w}, {Xi, Yi} = Transpose[poly];
Xip1 = RotateLeft[Xi];
Yip1 = RotateLeft[Yi];
u = UnitStep[y - Yi];
v = RotateLeft[u];
w = UnitStep[-((Xip1 - Xi) (y - Yi) - (x - Xi) (Yip1 - Yi))];
Total[(u (1 - v) (1 - w) - (1 - u) v w)] ≠ 0]];;dens = ContourPlot[PDF[𝒟, {x, y}]//Evaluate, {x, 0, 3000}, {y, 550, 4500}, PlotRange -> All, PlotPoints -> 50, Contours -> 15, ColorFunction -> "SolarColors", RegionFunction -> (inPolyQ[poly, #1, #2]&)];Show[dens, ListLinePlot[poly, PlotStyle -> Thick], ListPlot[dat, PlotMarkers -> {Automatic, 5}, PlotStyle -> Black], PlotLabel -> Text[Style["Volcanic Crater Density", {Bold, 18}]]]文本
Wolfram Research (2010),SmoothKernelDistribution,Wolfram 语言函数,https://reference.wolfram.com/language/ref/SmoothKernelDistribution.html (更新于 2016 年).
CMS
Wolfram 语言. 2010. "SmoothKernelDistribution." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2016. https://reference.wolfram.com/language/ref/SmoothKernelDistribution.html.
APA
Wolfram 语言. (2010). SmoothKernelDistribution. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/SmoothKernelDistribution.html 年
BibTeX
@misc{reference.wolfram_2026_smoothkerneldistribution, author="Wolfram Research", title="{SmoothKernelDistribution}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/SmoothKernelDistribution.html}", note=[Accessed: 05-December-2026]}
BibLaTeX
@online{reference.wolfram_2026_smoothkerneldistribution, organization={Wolfram Research}, title={SmoothKernelDistribution}, year={2016}, url={https://reference.wolfram.com/language/ref/SmoothKernelDistribution.html}, note=[Accessed: 05-December-2026]}