12.7 多元正态分布
*============================begin================================
clear
drawnorm x y, n(1000)
g z=exp(0.5*(-x^2-y^2))
scat3 x y z //在运行 sct3 之前需要先下载该命令,search scat3,net
scat3 x y z, msymbol(point) mcolor(gold) shadow(msize(0))
*============================end=================================
clear
drawnorm x y, n(10000)
g z=exp(0.5*(-x^2-y^2))
g y1=-x+invnormal(uniform())
g z1=exp(0.5*(-x^2-y1^2))
scat3 x y z, mcolor(gold) shadow(msize(0)) saving(1,replace)
scat3 x y1 z1, mcolor(gold) shadow(msize(0))saving(2,replace)
graph combine 1.gph 2.gph
0
.1
.2
.3
.4
y
-4 -2 0 2 4
x
y y
y
2021-12-08 12:24:44
2.41MB
stata
1