14.09.2015 Views

Matvec Users’ Guide

Matvec Users' Guide

Matvec Users' Guide

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

66 CHAPTER 10. LINEAR MODEL ANALYSES<br />

Now, at the <strong>Matvec</strong> prompt, I type<br />

> input try5<br />

LEAST SQUARE MEANS<br />

-------------------------------------------------------------<br />

herd lsmean sqrt(Var(kb)) p_value estimability<br />

1 7.42 1.4594 0.00705964<br />

2 9.11 1.36628 0.00262883<br />

-------------------------------------------------------------<br />

note 1: estimability = Max(mme*ginv(mme)*k - k);<br />

if it is non-zero, lsmean may or may not be estimable.<br />

note 2: sqrt(Var(kb)) is also called STD ERR (see SAS)<br />

10.7 Variance Components Estimation (VCE)<br />

There are two member functions of a model object for variance components estimation: M.vce emreml() and<br />

M.vce dfreml().<br />

M.vce_emreml(maxiter,interactive,stopval) estimates the variance components for random effects<br />

using EM REML algorithm. Three arguments are optional. The first argument maxiter is the maximum<br />

number of iterations allowed with the default value 1000; if you are running <strong>Matvec</strong> interactively, it allows you<br />

to add more iterations at run-time, thus a recommended maxiter value is 20 in order to monitor increment<br />

of restricted log-likelihood. The second argument interactive is the switch for interactive mode or noninteractive<br />

with the default value 1. The third argument stopval is the stop criterion with the default value<br />

1.0e-5.<br />

M.vce_dfreml("df_method",maxiter,stopval) estimates the variance components for random effects<br />

using DF REML algorithm. Three arguments are optional. The first argument "" is the<br />

name of derivative-free based maximization maximum algorithm with default name "powell"; the second<br />

maxiter is the maximum number of iterations allowed with default value 500000; the third stopval is the<br />

stop criterion with default value 1.0e-5.<br />

Both member functions return the BLUP solution which used the latest estimated variance components.<br />

Therefore, a semicolon (;) should always be used to end the functions to suppress printing of the length<br />

BLUP solution.<br />

For example, the following <strong>Matvec</strong> script is saved in a file called try6.<br />

D = Data();<br />

D.input("try.dat","animal\$ herd _skip y");<br />

P = Pedigree();<br />

P.input("try.ped");<br />

M = Model();<br />

M.equation("y = intercept + herd + animal");<br />

M.variance("residual",2.0); // initial variance value<br />

M.variance("animal",P,1.0); // initial variance value<br />

M.fitdata(D);<br />

M.vce_emreml(); // correct answer: sigma_e = 2.69863,<br />

// sigma_a = 2.20751<br />

Now, at the <strong>Matvec</strong> prompt, I type<br />

> input try6<br />

iteration sigma_1 ..... sigma_e log_likelihood<br />

0: 1 2 -6.10457331

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

Saved successfully!

Ooh no, something went wrong!