{"width":"100%","description":"\u3082\u3061\u308d\u3093R\u3067\u3002 2\u5909\u6570\u6b63\u898f\u5206\u5e03 2\u5909\u6570\u306e\u6b63\u898f\u5206\u5e03\u304b\u3089\u306e\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u306f\u3053\u3053\u306e\u3092\u305d\u306e\u307e\u307e\u307e\u306d\u3059\u308b\u3068 B <- 2000 x1 <- rep(NA,B+1) x2 <- rep(NA,B+1) x1[1] <- -2 x2[1] <- 1 for (i in 1:B){ x1[i+1] <- rnorm(1,1+0.7*(x2[i]-2),sqrt(1-0.7^2)) x2[i+1] <- rnorm(1,2+0.7*(x1[i+1]-1),sqrt(1-0.7^2)) } \u76f8\u95a2\u4fc2\u6570\u3082\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u3063\u3066\u3001 > cor(x1,x2) [1] 0.712666 \u6563\u5e03\u56f3\u3082\u3053\u3093\u306a\u611f\u3058\u3002\u3046\u307e\u304f\u3044\u3063\u3066\u307e\u3059\u306d\u3002 \u2026","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.yasuhisay.info%2Fentry%2F20090115%2F1231965900\" title=\"Gibbs Sampler Algorithm\u306b\u3088\u3063\u3066\u591a\u5909\u91cf\u6b63\u898f\u5206\u5e03\u304b\u3089\u306e\u30b5\u30f3\u30d7\u30eb\u62bd\u51fa\u3092\u884c\u306a\u3046 - yasuhisa&#39;s blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"syou6162","title":"Gibbs Sampler Algorithm\u306b\u3088\u3063\u3066\u591a\u5909\u91cf\u6b63\u898f\u5206\u5e03\u304b\u3089\u306e\u30b5\u30f3\u30d7\u30eb\u62bd\u51fa\u3092\u884c\u306a\u3046","url":"https://www.yasuhisay.info/entry/20090115/1231965900","categories":["R","MCMC"],"blog_url":"https://www.yasuhisay.info/","author_url":"https://blog.hatena.ne.jp/syou6162/","type":"rich","version":"1.0","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/s/syou6162/20161010/20161010132957.png","height":"190","blog_title":"yasuhisa's blog","provider_name":"Hatena Blog","published":"2009-01-15 05:45:00"}