# 다변량 비모수 확률과 기대값 추정

이변량 밀도의 PDF는 SmoothKernelDistribution를 이용하여 추정할 수 있으며, 거듭 제곱으로부터 만들어진 데이터와 기대값을 나타낸 것입니다.
 In[1]:= Xdist = MixtureDistribution[{2, .1}, {MultinormalDistribution[-1 {1, 1}, 2 IdentityMatrix[2]], MultinormalDistribution[2 {.5, .5}, .01 IdentityMatrix[2]]}]; BlockRandom[SeedRandom[15]; data = RandomVariate[dist, 250]];
 In[2]:= X\[ScriptCapitalD] = SmoothKernelDistribution[data];
 In[3]:= Xpdf = Show[ Plot3D[Evaluate@PDF[\[ScriptCapitalD], {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]
 Out[3]=
 In[4]:= X\[ScriptCapitalD] = SmoothKernelDistribution[data];
 In[5]:= XTable[Expectation[ x^i + y^i, {x, y} \[Distributed] \[ScriptCapitalD]], {i, 7}]
 Out[5]=