WinBUGS code for Problem #4

| | Comments (0)

I've modified the WinBUGS code a little (see below for comments on what I've changed) and uploaded it to the web site. In addition to the link to
problem-4-bugs.txt here, you'll also find a link to it on the detail pages where you find the data. I'll spend a few minutes at the beginning of lecture on Monday illustrating a couple of new things you'll need to know about running WinBUGS for this analysis.

The good news is that you only need to add code (a) to relate the observational components of variance to the causal components of variance (which should be pretty straightforward), (b) to estimate the heritability, and (c) to estimate the response to selection. The code for doing the regression of fitness in phenotype is already embedded. (I'll show you where on Monday.)

If you want to play with this code before lecture, you'll have to do one thing in addition to what you've done before. After Model->Specification “check model”, “load data”, and “compile”, you'll need to click “load inits” before clicking “gen inits” and updating. If that doesn't make sense, don't worry about it. Have a nice weekend, and I'll explain it on Monday.

Changes in the WinBUGScode

  • I fiddled with the priors on sd.sire, sd.dam, and sd.within to make sure that everything behaves properly.

  • I changed the regression model (slightly) to make it behave better.

  • I set nu equal to the observed mean phenotype, rather than estimating it with a prior.

  • I added code to estimate the mean fitness right below the regression model.

Leave a comment

About this Entry

This page contains a single entry by Kent published on October 28, 2006 1:14 PM.

Problem #4 -- relax for a while was the previous entry in this blog.

Further refinement is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.