# NOT RUN {
data(WarblerG)
A<-extractA(WarblerG)
ped<-matrix(NA, 100,3)
ped[,1]<-1:100
G<-simgenotypes(A, ped=ped, E1=0.1, E2=0.001, no_dup=2)
GdP<-GdataPed(G=G$Gobs, id=G$id)
model1<-MCMCped(GdP=GdP, nitt=1500, thin=1, burnin=500)
# The proposal distribution is to conservative for E1
# and the update is accepted about 70% of the time
plot(model1$E1)
autocorr(model1$E1)
# Succesive samples from the posterior distribution are
# strongly autocorrelated. Should of course run the chain
# for longer with a larger thinning interval, but a greater
# tuning parameter helps (now 3e-4, rather than 3e-5):
model2<-MCMCped(GdP=GdP, tP=tunePed(E1=10), nitt=1500,
thin=1, burnin=500)
plot(model2$E1)
autocorr(model2$E1)
# }
Run the code above in your browser using DataLab