Discussion:
[R-sig-ME] MCMCglmm bivariate with offset
Walid Mawass
2018-06-13 14:28:51 UTC
Permalink
Hello everyone,

I am working on a bivariate MCMCglmm model and I want to include an
offset term for my second response variable. I already know that for the
offset, i have to fix the coefficient to 1 through the prior but it is
not working in my case. I have 4 fixed effects fitted for both response
variables and the offset is fitted for the second one using
/at.level(trait,2)/.

prior1 <- list(B=list(V=diag(5)*1e8, mu=rep(0,5)), R=list(V=diag(2),
nu=3), G=list(G1=list(V=diag(2), nu=3),G2=list(V=diag(2), nu=3)))
prior1$B$mu[5]<- 1
prior1$B$V[5,5]<- 1e-8

is this the proper way to set the prior? or should the fixed effects
matrix have different dimensions since my model is bivariate:

model_multi <- MCMCglmm(cbind(AFR, OffMortality)~trait-1 + trait:COEFPAR
+ trait:I(COEFPAR*COEFPAR) + trait:TWIN + trait:YEARM+
at.level(trait,2):log(FERTILITY), random =
~us(trait):animal+us(trait):MOTHERW, rcov = ~us(trait):units, data =
IAC, pedigree = prunedPed, family = c("gaussian", "poisson"), nitt =
3500000, burnin = 500000, thin = 3000, prior = prior1, verbose = FALSE,
pr=TRUE)

Thank you in advance for any advice.
--
Walid Mawass

Ph.D. candidate in Cellular and Molecular Biology

Population Genetics Laboratory

University of Québec at Trois-Rivières
3351, boul. des Forges, C.P. 500
Trois-Rivières (Québec) G9A 5H7
Telephone: 819-376-5011 poste 3384


[[alternative HTML version deleted]]
HADFIELD Jarrod
2018-06-13 18:08:09 UTC
Permalink
Hi,

I think you have 11 fixed effects, not 5. Replace 5 with 11 and then it should work. Also, you should expect the posterior to be sensitive to the prior if you have nu=3 unless there is a lot of information in the data.

Cheers,

Jarrod
Post by Walid Mawass
Hello everyone,
I am working on a bivariate MCMCglmm model and I want to include an
offset term for my second response variable. I already know that for the
offset, i have to fix the coefficient to 1 through the prior but it is
not working in my case. I have 4 fixed effects fitted for both response
variables and the offset is fitted for the second one using
/at.level(trait,2)/.
prior1 <- list(B=list(V=diag(5)*1e8, mu=rep(0,5)), R=list(V=diag(2),
nu=3), G=list(G1=list(V=diag(2), nu=3),G2=list(V=diag(2), nu=3)))
prior1$B$mu[5]<- 1
prior1$B$V[5,5]<- 1e-8
is this the proper way to set the prior? or should the fixed effects
model_multi <- MCMCglmm(cbind(AFR, OffMortality)~trait-1 + trait:COEFPAR
+ trait:I(COEFPAR*COEFPAR) + trait:TWIN + trait:YEARM+
at.level(trait,2):log(FERTILITY), random =
~us(trait):animal+us(trait):MOTHERW, rcov = ~us(trait):units, data =
IAC, pedigree = prunedPed, family = c("gaussian", "poisson"), nitt =
3500000, burnin = 500000, thin = 3000, prior = prior1, verbose = FALSE,
pr=TRUE)
Thank you in advance for any advice.
--
Walid Mawass
Ph.D. candidate in Cellular and Molecular Biology
Population Genetics Laboratory
University of Québec at Trois-Rivières
3351, boul. des Forges, C.P. 500
Trois-Rivières (Québec) G9A 5H7
Telephone: 819-376-5011 poste 3384
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
Walid Mawass
2018-06-13 18:51:37 UTC
Permalink
Thank you Jarrod, the model finally ran with your advice. I am aware of
the sensitivity of the posterior distribution, this is just my first
prior. I am going to use another one with nu = 1.002.

Cheers

Walid
Post by HADFIELD Jarrod
Hi,
I think you have 11 fixed effects, not 5. Replace 5 with 11 and then it should work. Also, you should expect the posterior to be sensitive to the prior if you have nu=3 unless there is a lot of information in the data.
Cheers,
Jarrod
Post by Walid Mawass
Hello everyone,
I am working on a bivariate MCMCglmm model and I want to include an
offset term for my second response variable. I already know that for the
offset, i have to fix the coefficient to 1 through the prior but it is
not working in my case. I have 4 fixed effects fitted for both response
variables and the offset is fitted for the second one using
/at.level(trait,2)/.
prior1 <- list(B=list(V=diag(5)*1e8, mu=rep(0,5)), R=list(V=diag(2),
nu=3), G=list(G1=list(V=diag(2), nu=3),G2=list(V=diag(2), nu=3)))
prior1$B$mu[5]<- 1
prior1$B$V[5,5]<- 1e-8
is this the proper way to set the prior? or should the fixed effects
model_multi <- MCMCglmm(cbind(AFR, OffMortality)~trait-1 + trait:COEFPAR
+ trait:I(COEFPAR*COEFPAR) + trait:TWIN + trait:YEARM+
at.level(trait,2):log(FERTILITY), random =
~us(trait):animal+us(trait):MOTHERW, rcov = ~us(trait):units, data =
IAC, pedigree = prunedPed, family = c("gaussian", "poisson"), nitt =
3500000, burnin = 500000, thin = 3000, prior = prior1, verbose = FALSE,
pr=TRUE)
Thank you in advance for any advice.
--
Walid Mawass
Ph.D. candidate in Cellular and Molecular Biology
Population Genetics Laboratory
University of Québec at Trois-Rivières
3351, boul. des Forges, C.P. 500
Trois-Rivières (Québec) G9A 5H7
Telephone: 819-376-5011 poste 3384
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
--
Walid Mawass

Ph.D. candidate in Cellular and Molecular Biology

Population Genetics Laboratory

University of Québec at Trois-Rivières
3351, boul. des Forges, C.P. 500
Trois-Rivières (Québec) G9A 5H7
Telephone: 819-376-5011 poste 3384
Loading...