Estimate Multivariate Nonparametric Probabilities and Expectations
Estimate Multivariate Nonparametric Probabilities and Expectations
The PDF of a bivariate density estimate, using SmoothKernelDistribution, is shown with the data it was created from and the expected values of successive power sums.
dist = MixtureDistribution[{2, .1}, {MultinormalDistribution[-1 {1, 1}, 2 IdentityMatrix[2]], MultinormalDistribution[2 {.5, .5}, .01 IdentityMatrix[2]]}];
BlockRandom[SeedRandom[15];data = RandomVariate[dist, 250]];𝒟 = SmoothKernelDistribution[data];Show[Plot3D[PDF[𝒟, {x, y}], {x, -6, 5}, {y, -6, 5}, PlotRange -> {{-6, 5}, {-6, 5}, All}, ColorFunction -> (Opacity[Rescale[#3, {0, .6}, {0, 1}], ColorData["DeepSeaColors"][#3]]&), Mesh -> 45, MeshStyle -> Gray, MeshFunctions -> {#3&}, PlotPoints -> 50, ImageSize -> 550, ViewPoint -> {Pi, -Pi, 1}], ListPointPlot3D[Partition[Flatten[Transpose[{data, ConstantArray[0, Length[data]]}]], 3], PlotStyle -> Directive[PointSize -> .0075]], AspectRatio -> 1, Boxed -> False]