hello all (sorry for the long story!)
in the problem below there are two parameters, p1 and p2. i derived an mdi
prior for the params. (say theta = c(p1,p2))
the actual form is
f(theta|data) isprop exp(-5*log(p2) + 3.530588 - 5*n)
(r=5, Sgamstuff = 3.530588 in the code below)
(which can be simplified i know)
p1 does not enter the prior
in coding up the priors in winbugs i specified the prior as
f(p1,p2|data) = h(p1|data)*g(p2|data) where g(p2|data) is 1 (improper
uniform)
is this correct?
is there a way of setting the prior for f(theta|data) directly!
*****************************************************
*****************************************************
*****************************************************
a related question to the previous one:
=============================
suppose we have a vector of unknowns, u. say n by1
we then specify a prior for u of the form
propto exp(-.5*l*u'Ku) * l ^(.5*(n-2))
here K is not invertible. it definitely is not diagonal
l is some other parameter
how would we set the prior for u in winbugs?
*****************************************************
*****************************************************
*****************************************************
i've included the code and data below
your help will be much appreciated!
++++++++++++++++++++++++++++++++++++
model
{
#the likelihood
for (i in 1:n)
{
zeros[i]<-0
zeros[i] ~ dpois( phi[i])
phi[i] <- (r)*log(p2) + exp(-(Z[i,r] - p1)/p2 ) + Z[i, 6]/p2 - r*p1/p2
}
#prior for p1
p1~dflat()
#prior for p2
zerop2<-0
zerop2~dpois(phip2)
#phip2<- r*log(p2) + n*r -Sgamstuff #i know this can simplify
phip2<- r*log(p2)
p2~dflat()
}
list(p1=5, p2=5)
you can play around with various starts!
list(n=50, r=5, Sgamstuff = 3.530588,
Z=structure(.Data=
c(1.2816,0.84902,0.75703,-0.64138,-
1.046,1.20027,0.69963,0.46723,0.46124,-0.10384,-
0.34639,1.17787,1.8548,1.7657,-0.33296,-1.0528,-
1.4362,0.79854,1.225,0.89187,0.1841,0.096511,-0.46322,1.934261,-1.4453,-
1.4636,-1.572,-1.7269,-1.9256,-8.1334,0.32839,-0.5279,-0.96795,-1.2694,-
1.5018,-3.93866,-0.047188,-0.57731,-1.3291,-1.3808,-1.6806,-
5.014998,0.59902,0.036695,-0.11112,-0.13955,-0.7349,-0.349855,0.75194,-
0.93238,-0.94877,-0.96997,-1.0519,-3.15108,-0.79503,-1.0022,-1.4699,-
1.4794,-1.6282,-6.37473,1.7349,0.30938,-0.28788,-0.62354,-
0.83581,0.29705,0.53136,0.026861,-0.40832,-1.4396,-1.4772,-2.766899,-
0.50148,-1.4149,-1.7946,-2.0033,-2.1304,-7.84468,1.0358,-0.67112,-
0.90373,-1.3489,-1.4346,-3.32255,-0.47532,-0.87337,-0.92666,-1.6167,-
2.0672,-5.95925,1.7494,1.0895,0.1372,0.054737,-0.31892,2.711917,-
0.68143,-0.77126,-0.9226,-1.1138,-1.3502,-4.83929,-0.47296,-0.55862,-
0.71522,-1.0596,-1.504,-4.3104,-0.70278,-1.2032,-1.2418,-1.7104,-1.8532,-
6.71138,-0.020882,-1.0443,-1.3537,-1.4643,-1.4914,-
5.374582,1.3773,0.40829,-0.26853,-0.93082,-1.3277,-0.74146,-0.12222,-
0.27343,-0.48635,-0.75489,-1.1113,-2.74819,2.6231,-0.28863,-0.77143,-
0.80819,-1.0308,-0.27595,-2.0599,-2.1304,-2.1915,-2.2505,-2.3091,-
10.9414,1.1904,-1.1216,-1.1245,-1.1634,-1.224,-3.4431,-0.51151,-0.61733,-
1.361,-1.698,-1.8704,-6.05824,-0.95535,-1.601,-1.6245,-1.9437,-1.9953,-
8.11985,-0.97401,-1.4274,-1.4646,-1.9675,-2.248,-8.08151,0.64866,-1.2696,-
1.3565,-1.465,-1.6844,-5.12684,-0.11409,-0.61217,-0.82564,-1.0508,-
1.1986,-3.8013,2.4348,0.11414,0.087324,0.082564,-
0.85137,1.867458,2.9083,-1.2003,-1.267,-1.2939,-1.3017,-2.1546,1.1218,-
2.1174,-2.189,-2.2307,-2.3164,-7.7317,1.0571,0.037076,-1.1224,-1.2672,-
1.5055,-2.800924,1.1194,0.086465,-0.7168,-1.7491,-1.7783,-3.038335,-
0.51362,-0.56349,-0.89051,-0.92561,-1.1151,-4.00833,-1.3659,-1.4809,-
1.5125,-1.5879,-1.6301,-7.5773,3.7788,1.568,0.70359,-0.2516,-
0.77175,5.02704,-0.22379,-1.1173,-1.7102,-2.0237,-2.3361,-
7.41109,0.60572,-0.66215,-0.69109,-0.85799,-1.4895,-
3.09501,0.70537,0.30384,0.24617,-0.48115,-0.75487,0.0193599999999999,-
0.17287,-0.68503,-0.94423,-1.1191,-1.2519,-4.17313,1.9494,-0.3279,-
0.64597,-0.73411,-1.1435,-0.90208,-0.4435,-0.48946,-1.1747,-1.3722,-
1.4123,-4.89216,-0.19253,-0.33269,-0.72216,-1.7305,-1.9302,-
4.90808,0.57179,-0.6949,-0.92569,-1.5218,-1.6094,-4.18,4.4624,-0.69994,-
1.3526,-1.5602,-1.5627,-0.71304,-0.13541,-1.1173,-1.2028,-1.9028,-2.0344,-
6.39271,0.9217,0.52137,-0.50955,-0.68864,-1.4844,-1.23952,-0.12453,-
0.26253,-1.0553,-1.2615,-1.3565,-4.06036), .Dim=c(50,6)))
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|