R_2変量正規分布 の変更点 - アールメカブ

アールメカブ


R_2変量正規分布 の変更点


*Baayen  より [#c9a81c58]

[[Analyzing Linguistic Data:http://www.amazon.co.jp/Analyzing-Linguistic-Data-Introduction-Statistics/dp/0521882591/]]

pp.105-

 library(MASS)
 x <- mvrnorm(n = 1000, mu = c(0,0), 
 Sigma = cbind(c(1, 0.8),  c(0.8,1)))

# 単変量の場合の density 関数にあたるのが kde2d
 persp(kde2d(x[,1], x[,2], n = 50),
      phi = 30, theta = 20, # angle の指定
      d = 10,
      col = "lightblue",
      shade = 0.75, ltheta = -100,
      border = NA,
      expand = 0.5,
      xlab = "X",ylab ="Y", zlab = "density")
 mtext("bivariate standard normal", 3, 1)

kde2d 関数の引数 n が分かりにくいが,x,y 座標の数

#ref(baayen106.png,center,nowrap,80%, lmreg による画像)