刚开始学习R语言,能不能请高手帮我解释一下下面这段程度每一句代表什么意思?
或者我在哪可以查到,我确实有很多地方看不懂, 比如differ那句是起什么作用……
谢谢高手,不胜感激
library(BAYSTAR)
data(unemployrate)
x<- unemployrate
nx<- length(x)
differ.x<- x[2:nx]-x[2:nx-1]
lagp1<- c(2,3,4,10,12)
lagp2<- c(2,3,12)
## Total MCMC iterations and burn-in iterations
Iteration<- 10000
Burnin<- 2000
## A RW (random walk) MH algorithm is used in simulating the threshold value
## Step size for the RW MH
step.thv<- 2.5
out1 <- BAYSTAR(differ.x,lagp1,lagp2,Iteration,Burnin,constant=0,step.thv=step.thv)
d0 <- 4
out2 <- BAYSTAR(differ.x,lagp1,lagp2,Iteration,Burnin,d0,constant=0,step.thv=step.thv)
## Comparison with DIC
library(coda)
geweke.diag(out2$posterior, frac1=0.1, frac2=0.5)