# NOT RUN {
# In this example we simulate a pedigree and then fix the
# pedigree and estimate the population level paarmeters
data(WarblerP)
var1<-expression(varPed(c("lat", "long"), gender="Male",
relational="OFFSPRING"))
# paternity is to be modelled as a function of distance
# between offspring and male territories
res1<-expression(varPed("offspring", restrict=0))
# indivdiuals from the offspring generation are excluded as parents
res2<-expression(varPed("terr", gender="Female", relational="OFFSPRING",
restrict="=="))
# mothers not from the offspring territory are excluded
PdP<-PdataPed(formula=list(var1,res1,res2), data=WarblerP, USsire=FALSE)
simped<-simpedigree(PdP, beta=-0.25)
# simulate a pedigree where paternity drops with distance (beta=-0.25)
sP<-startPed(ped=simped$ped, estP=FALSE)
model1<-MCMCped(PdP=PdP, sP=sP, nitt=3000, thin=2, burnin=1000)
plot(model1$beta)
# The true underlying value is -0.25
# }
Run the code above in your browser using DataLab