ä»ããæã¯ããããMCMC (Markov Chain Monte Carlo; ãã«ã³ãé£éã¢ã³ãã«ã«ã)ã使ããããã«ãªããã¨ãã¾ãã¯ç°¡åãªä¾ãã試ãã¦ã¿ãã æå§ãã«ãæ£è¦ä¹±æ°ããçæããæ¨æ¬ã®å¹³åã¨æ¨æºåå·®ãæ¨å®ãã¦ã¿ãã ãã¯ãRã使ç¨ãMCMCpackããã±ã¼ã¸ã ãããããã¤ã³ã¹ãã¼ã«ãã¦ããã¦ãå¼ã³åºããMCMCpackä¸ã®MCMCmetrop1R()é¢æ°ãå©ç¨ãã¦ãã¡ããããªã¹æ³ã«ããMCMCæ¨å®ããããªãã library(MCMCpack) ä¹±æ°ç³»åãåæåã set.seed(1) å¹³å10ãæ¨æºåå·®3ã®ä¹±æ°ã1000åçæãã¦ãxã«å ¥ããã m <- 10 s <- 3 x <- rnorm(1000, m, s) MCMCæ¨å®ã«ä½¿ç¨ããé¢æ°ãç¨æãããbetaã¯è¦ç´ æ°2ã®ãã¯ãã«ãbeta[1]ãå¹³åãbeta[2]ãæ¨æºåå·®ã§ãbetaãæ¨å®ãããé¢æ°ã®è¿ãå¤
{{#tags}}- {{label}}
{{/tags}}