14.09.2015 Views

Matvec Users’ Guide

Matvec Users' Guide

Matvec Users' Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

60 CHAPTER 10. LINEAR MODEL ANALYSES<br />

• either the pedigree file or the raw data file can contain comments which is started from the double<br />

backslash. This could be very handy when you want to write down a note about your data. Comments<br />

and empty lines will be quietly ignored by <strong>Matvec</strong>.<br />

• missing values must be represented by a dot(.) with an exception that unknown parents in the pedigree<br />

file can also be represented by 0 (the cost is that we can’t use 0 as a legitimate animal identification any<br />

more). Missing values can appear anywhere in both files. <strong>Matvec</strong> will automatically and appropriately<br />

handle missing values for you.<br />

• animal or herd identification can be either a string or a number.<br />

In the following several sections, we will demonstrate how to analyze the above data using linear model<br />

methodology.<br />

10.3.2 Model<br />

A single trait animal model is assumed:<br />

y i = µ + h i + a i + e i<br />

10.3.3 Obtain BLUP using matrix algebra<br />

First of all, we write down a script using matrix tools and functions provided by <strong>Matvec</strong>. You can use any<br />

of you favorable ASCII editor, and save the file as try1 in your current working directory.<br />

A = [1.0, 0.0, 0.5, 0.0, 0.25;<br />

0.0, 1.0, 0.5, 0.5, 0.25;<br />

0.5, 0.5, 1.0, 0.25, 0.5;<br />

0.0, 0.5, 0.25,1.0, 0.125;<br />

0.25,0.25,0.5, 0.125,1.0]; // A = relationship matrix<br />

X = [1.0, 1.0, 0.0;<br />

1.0, 1.0, 0.0;<br />

1.0, 1.0, 0.0;<br />

1.0, 0.0, 1.0;<br />

1.0, 0.0, 1.0;<br />

1.0, 0.0, 1.0];<br />

Z = [0.0, 1.0, 0.0, 0.0, 0.0;<br />

0.0, 1.0, 0.0, 0.0, 0.0;<br />

0.0, 0.0, 1.0, 0.0, 0.0;<br />

0.0, 0.0, 0.0, 1.0, 0.0;<br />

0.0, 0.0, 0.0, 0.0, 1.0;<br />

0.0, 0.0, 0.0, 0.0, 1.0];<br />

y = [6.0;<br />

8.0;<br />

8.0;<br />

7.0;<br />

9.0;<br />

12.0];<br />

XPX = X’*X;<br />

XPZ = X’*Z;<br />

ZPZ = Z’*Z;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!