The fuller Model
Description:
It
attempts to take account of the uncertainty in the allele frequencies but also
uncertainty in the estimates of the individual inbreeding coefficients F.
This is a random effects model.
model { #p[twinpair][celltype][whichtwin][replicate] for (i in 1:N) { for (j in 1:2) { for (k in 1:2) { for (m in 1:2) { p[i,j,k,m] ~ dnorm(pp[i,j,k,1],tau[1])I(0,1); } p[i,j,k,3] ~dnorm(pp[i,j,k,2],tau[1])I(0,1); for (m in 1:2) { pp[i,j,k,m] ~ dnorm(pm[i,j,k],tau[2])I(0,1); } } } } for (i in 1:2) { tau[i]~dgamma(0.001, 0.001) sigma[i] <- 1/tau[i]; } #pm[twinpair][celltype][whichtwin for (i in 1:N) { for (k in 1:2) { pm[i,1,k]~dbeta(alpha[i,k,1],alpha[i,k,2]) pm[i,2,k]~dbeta(beta[i],beta[i]); alpha[i,k,1] <- (1/f[2,i]-1)*pm[i,2,k]; alpha[i,k,2] <- (1/f[2,i]-1)*(1-pm[i,2,k]); } beta[i] <- (1/f[1,i]-1)*0.5; f[1,i] ~ dnorm(fm1,tauf[1])I(0,1); f[2,i] ~ dnorm(fm2,tauf[2])I(0,1); } fm1~dunif(0,1) for (i in 1:2) { tauf[i]~dgamma(0.001,0.001); sigmaf[i]<-1/tauf[i]; } fm2 <- 1-exp(-d); d<-gen/nstem gen~dgamma(2,0.0333333333); nstem~dlnorm(14,1); #d~dgamma(0.001,0.001) }
list(p = structure(.Data = c(0.2957746, 0.3160055, NA, 0.4128009, 0.4015560, NA, 0.5145631,0.5, NA, 0.5238095, 0.5121951, NA, 0.4388328, NA, 0.463807,0.4155465, NA, 0.4249569, 0.543379, NA, 0.5535714, 0.543379,NA, 0.5594714, 0.751861, NA, 0.7275204, 0.610895, NA, 0.5867769, 0.465812, NA, 0.4683679, 0.3954051, NA, 0.3990385, 0.2872416, 0.263623, NA, 0.316473, 0.2867332, NA, 0.4337486, 0.364676, NA, 0.3552547, 0.3311037, NA, 0.4858612, 0.5260664, NA, 0.8652291, 0.870801, NA, 0.3710692, 0.378882, NA, 0.8113208, 0.8168498, NA, 0.6336996, 0.6336996, NA, 0.6710526, 0.669967,NA, 0.5614035, 0.5515695, NA, 0.5708155, 0.5708155, NA, 0.08340972,NA, 0.09502262, 0.09747292, NA, 0.1055456, 0.1941982, NA, 0.1687448,0.1843393, NA, 0.1532599, 0.5192308, 0.5145631, NA, 0.8039216, 0.7826087, NA, 0.5918367, 0.5689655, NA, 0.8039216, 0.7938144, NA, 0.4026284, 0.4075829, 0.4086339, 0.8618785, 0.8248687, 0.8248687,0.4110718, 0.4089835, 0.4075829, 0.8579545, 0.8336106, 0.8344371, 0.21875, NA, 0.21875, 0.1830065, NA, 0.1728701, 0.4165694, NA, 0.3924666, 0.4347089, NA, 0.4121105, 0.7361478, NA, 0.7368421, 0.5918367, NA, 0.5726496, 0.6254682, NA, 0.6168582, 0.632353, NA, 0.632353, 0.6309963, 0.6350365, NA, 0.6168582, 0.6124031,NA, 0.5515695, 0.5348837, NA, 0.5515695, 0.537037, NA, 0.609375, NA, NA, 0.6960486, NA, NA, 0.6350365, NA, NA, 0.6855346, NA, NA, 0.5119571, NA, NA, 0.4462901, NA, NA, 0.4910941, NA, NA,0.4632313, NA, NA, 0.4447529, NA, NA, 0.4219653, NA, NA, 0.4739611,NA, NA, 0.4272623, NA, NA, 0.5884774, 0.6254682, NA, 0.7084548,0.7118156, NA, 0.6226415, 0.6168582, NA, 0.6875, 0.6805112, NA, 0.2997199, NA, 0.2867332, 0.4708995, NA, 0.4692144, 0.467802, NA, 0.4453688, 0.5305164, NA, 0.5309568, 0.7142857, 0.7050147,0.6742671, 0.0430622, 0.0430622, 0.03846154, 0.6805112, 0.7245179, 0.6884735, 0.05926623, 0.06279288, 0.05365761, 0.6363636, NA, NA, 0.6350365, NA, NA, 0.632353, NA, NA, 0.6240602, NA, NA, 0.5412844,NA, NA, 0.4946943, NA, NA, 0.6441281, NA, NA, 0.5652174, NA, NA, 0.6, NA, 0.5780591, 0.4444444, NA, 0.3853719, 0.651568, NA, 0.5967742, 0.4897959, NA, 0.443517, 0.4269341, 0.4096812, 0.4011976, 0.4772608, 0.4609164, 0.4544463, 0.3074792, 0.3074792, 0.3069993, 0.5073892, 0.5145631, 0.4532531, 0.5412844, NA, 0.5215311, 0.4824017, NA, 0.4805195, 0.448428, NA, 0.465812, 0.4033413, NA, 0.448428, 0.6632997, NA, NA, 0.6376812, NA, NA, 0.6503497, NA, NA, 0.58159, NA, NA, 0.5918367, NA, 0.5918367, 0.610895, NA, 0.6124031, 0.6575342, NA, 0.6212121, 0.5726496, NA, 0.6240602, 0.07663897, 0.0800368, NA, 0.01922322, 0.01400118, NA, 0.3455497, 0.3421053, NA, 0.03567985, 0.03344288, NA, 0.8148148, NA, 0.8022545, 0.5049505, NA, 0.4778068, 0.3548387, NA, 0.3548387, 0.726776, NA, 0.661017, 0.5726496, NA, 0.5614035, 0.8938429, NA, 0.8466258, 0.609375, NA, 0.6212121,0.5024876, NA, 0.3993994, 0.5708155, NA, NA, 0.609375, NA, NA, 0.4597515, NA, NA, 0.4736842, NA, NA, 0.5475113, NA, NA, 0.543379, NA, NA, 0.4772608, NA, NA, 0.4994995, NA, NA, 0.1721854, NA, NA, 0.1496599, NA, NA, 0.1341991, NA, NA, 0.1474851, NA, NA, 0.2902768, NA, 0.2927864, 0.4158879, NA, 0.3738259, 0.3894994, NA, 0.4044074, 0.4011976, NA, 0.4072318, 0.6124031, NA, 0.6226415, 0.5169082, NA, 0.5260664, 0.490316, NA, 0.4972348, 0.5215311,NA, 0.5412844, 0.2732558, 0.2957746, NA, 0.5614035, 0.5535714, NA, 0.2852037, 0.3293092, NA, 0.4568169, 0.449945, NA, 0.5327103, 0.6168582, NA, 0.5575221, 0.5475113, NA, 0.5934959, 0.6309963, NA, 0.5121951, 0.5305164, NA, 0.3485342, NA, NA, 0.5305164, NA,NA, 0.3784960, NA, NA, 0.5305164, NA, NA, 0.5348837, NA, NA,0.3765586, NA, NA, 0.537037, NA, NA, 0.4472084, NA, NA, 0.6402878, NA, 0.6078431, 0.6815287, NA, 0.744898, 0.691358, NA, 0.6884735,0.6533795, NA, 0.6884735, 0.6794872, NA, NA, 0.465812, NA, NA,0.5412844, NA, NA, 0.5073892, NA, NA, 0.7792494, NA, 0.7493734, 0.8046875, NA, 0.7093023, 0.609375, NA, 0.6226415, 0.5454545, NA, 0.6240602, 0.8349835, NA, NA, 0.4472084, NA, NA, 0.8095238, NA, NA, 0.465812, NA, NA, 0.9801587, NA, 0.9767442, 0.6644295, NA, 0.6875, 0.982906, NA, 0.9636364, 0.6503497, NA, 0.6563574, 0.271137, NA, NA, 0.8780488, NA, NA, 0.3602047, NA, NA, 0.832776, NA, NA, 0.3442623, NA, 0.3122421, 0.6644295, NA, 0.6774194, 0.4343891, NA, 0.4065282, 0.6, NA, 0.6254682, 0.5884774, NA, NA, 0.4977398,NA, NA, 0.6138996, NA, NA, 0.3975904, NA, NA, 0.486653, NA, NA, 0.308915, NA, NA, 0.5215311, NA, NA, 0.3355482, NA, NA),.Dim = c(46, 2, 2, 3)),N=46),list(gen=400,nstem=500,fm1=0.05,tau=c(100,100) ,tauf=c(100,100), pm= structure(.Data= c(0.2957746, 0.4128009, 0.5145631, 0.5238095, 0.4388328,0.4155465, 0.543379, 0.543379, 0.751861, 0.610895, 0.465812,0.3954051, 0.2872416, 0.316473, 0.4337486, 0.3552547, 0.4858612, 0.8652291, 0.3710692, 0.8113208, 0.6336996, 0.6710526, 0.5614035, 0.5708155, 0.08340972, 0.09747292, 0.1941982, 0.1843393, 0.5192308, 0.8039216, 0.5918367, 0.8039216, 0.4026284, 0.8618785, 0.4110718, 0.8579545, 0.21875, 0.1830065, 0.4165694, 0.4347089, 0.7361478,0.5918367, 0.6254682, 0.632353, 0.6309963, 0.6168582, 0.5515695, 0.5515695, 0.609375, 0.6960486, 0.6350365, 0.6855346, 0.5119571, 0.4462901, 0.4910941, 0.4632313, 0.4447529, 0.4219653, 0.4739611, 0.4272623, 0.5884774, 0.7084548, 0.6226415, 0.6875, 0.2997199, 0.4708995, 0.467802, 0.5305164, 0.7142857, 0.0430622, 0.6805112, 0.05926623, 0.6363636, 0.6350365, 0.632353, 0.6240602, 0.5412844, 0.4946943, 0.6441281, 0.5652174, 0.6, 0.4444444, 0.651568, 0.4897959, 0.4269341, 0.4772608, 0.3074792, 0.5073892, 0.5412844, 0.4824017, 0.448428, 0.4033413, 0.6632997, 0.6376812, 0.6503497, 0.58159,0.5918367, 0.610895, 0.6575342, 0.5726496, 0.07663897, 0.01922322, 0.3455497, 0.03567985, 0.8148148, 0.5049505, 0.3548387, 0.726776, 0.5726496, 0.8938429, 0.609375, 0.5024876, 0.5708155, 0.609375,0.4597515, 0.4736842, 0.5475113, 0.543379, 0.4772608, 0.4994995, 0.1721854, 0.1496599, 0.1341991, 0.1474851, 0.2902768, 0.4158879, 0.3894994, 0.4011976, 0.6124031, 0.5169082, 0.490316, 0.5215311,0.2732558, 0.5614035, 0.2852037, 0.4568169, 0.5327103, 0.5575221, 0.5934959, 0.5121951, 0.3485342, 0.5305164, 0.3784960, 0.5305164,0.5348837, 0.3765586, 0.537037, 0.4472084, 0.6402878, 0.6815287, 0.691358, 0.6533795, 0.6794872, 0.465812, 0.5412844, 0.5073892, 0.7792494, 0.8046875, 0.609375, 0.5454545, 0.8349835, 0.4472084,0.8095238, 0.465812, 0.9801587, 0.6644295, 0.982906, 0.6503497,0.271137, 0.8780488, 0.3602047, 0.832776, 0.3442623, 0.6644295, 0.4343891, 0.6, 0.5884774, 0.4977398, 0.6138996, 0.3975904, 0.486653,0.308915, 0.5215311, 0.3355482), .Dim = c(46,2, 2)))