楼主: 穆穆爱周浩
1067 5

要sv模型代码的原模型公式,还有代码赋值也得告诉我 [推广有奖]

  • 0关注
  • 0粉丝

VIP1

小学生

78%

还不是VIP/贵宾

-

威望
0
论坛币
1262 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
221 点
帖子
9
精华
0
在线时间
6 小时
注册时间
2018-4-12
最后登录
2018-7-16

200论坛币
第一个SV-T
model{
for(i in 1:n)
{y[i]~dt(0,p[i],omega)
p[i]<-exp(-theta[i])
}
theta[1]~dnorm(mu,itau2)
for(j in 2:n)
{theta[j]~dnorm(theta2[j],itau2)
theta2[j]<-mu+phi*(theta[j-1]-mu)}
phi<-2*phi1-1
tau<-sqrt(1/itau2)
mu~dnorm(0,0.01)
itau2~dgamma(2.5,0.025)
phi1~dbeta(20,1.5)
omega~dchisqr(8)
}



第二个SV-N
model{
for(i in 1:n)
{p[i]<-1/exp(theta[i])
y[i]~dnorm(0,p[i])
}
mu~dnorm(0,0.01)
phi1~dbeta(20,1.5)
itau2~dgamma(2.5,0.025)
phi<-2*phi1-1
tau<-sqrt(1/itau2)
theta0~dnorm(mu,itau2)
thmean[1]<-mu+phi*(theta0-mu)
theta[1]~dnorm(thmean[1],itau2)
for(j in 2:n)
{thmean[j]<-mu+phi*(theta[j-1]-mu)
theta[j]~dnorm(thmean[j],itau2)
}
}



第三个SV-MT
model{
for(i in 1:n)
{y[i]~dt(v[i],p[i],omega)
v[i]<-d*exp(theta[i])
p[i]<-exp(-theta[i])
}
theta[1]~dnorm(mu,itau2)
for(j in 2:n)
{theta[j]~dnorm(theta2[j],itau2)
theta2[j]<-mu+phi*(theta[j-1]-mu)}
phi<-2*phi1-1
tau<-sqrt(1/itau2)
mu~dnorm(0,0.01)
itau2~dgamma(2.5,0.025)
phi1~dbeta(20,1.5)
d~dnorm(0,1)
omega~dchisqr(8)
}



第四个SV-MN
model{
for(i in 1:n)
{v[i]<-d*exp(theta[i])
p[i]<-1/exp(theta[i])
y[i]~dnorm(v[i],p[i])
}
phi<-2*phi1-1
tau<-sqrt(1/itau2)
mu~dnorm(0,0.01)
itau2~dgamma(2.5,0.025)
phi1~dbeta(20,1.5)
d~dnorm(0,1)
theta0~dnorm(mu,itau2)
thmean[1]<-mu+phi*(theta0-mu)
theta[1]~dnorm(thmean[1],itau2)
for(j in 2:n)
{thmean[j]<-mu+phi*(theta[j-1]-mu)
theta[j]~dnorm(thmean[j],itau2)
}
}


第五个leverage SV
model
{                                                               
for (i in 1:n) {
Ymean[i]<-rho/tau*exp(0.5*theta[i])*(theta[i+1]-mu-phi*(theta[i]-mu));
Yisigma2[i] <- 1/(exp(theta[i])*(1-rho*rho));
y[i]~ dnorm(Ymean[i],Yisigma2[i]);   
    }     
isigma2<-(1-phi*phi)*itau2;                                                        
theta0 ~ dnorm(mu,isigma2);  
thetamean[1] <- mu + phi*(theta0-mu);   
theta[1] ~ dnorm(thetamean[1],itau2);                                 
for (i in 2:(n+1)) {                                                                    
thetamean[i] <- mu + phi*(theta[i-1]-mu);                                   
theta[i]~dnorm(thetamean[i],itau2);}                                 
phi1 ~ dbeta(20,1.5);     
phi <- 2*phi1-1;     
mu ~ dnorm(0,0.04);                                                              
itau2 ~ dgamma(2.5,0.025);                                                      
tau <- sqrt(1/itau2) ;
rho ~ dunif(-1,1)                                                        
}


关键词:SV模型 omega model Mega mode
沙发
穆穆爱周浩 发表于 2018-5-25 22:54:26 |只看作者 |坛友微信交流群
需要告诉我代码里的各个赋值,比如 mu=0,phi1=1,itau2=0.1之类的

使用道具

藤椅
無灬罪 在职认证  发表于 2018-5-25 23:07:40 |只看作者 |坛友微信交流群
支持一下

使用道具

板凳
穆穆爱周浩 发表于 2018-5-25 23:30:04 来自手机 |只看作者 |坛友微信交流群
無灬罪 发表于 2018-5-25 23:07
支持一下
谢谢

使用道具

报纸
穆穆爱周浩 发表于 2018-5-26 12:04:06 来自手机 |只看作者 |坛友微信交流群
没人会吗?还是悬赏币少啊,给我都对的话,都能运行的话我可以追加悬赏

使用道具

地板
穆穆爱周浩 发表于 2018-6-13 07:15:31 来自手机 |只看作者 |坛友微信交流群
没有人会嘛?

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-27 19:34