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.

11.1. GENERALIZED LINEAR MODEL 71<br />

Table 11.2: Available link functions<br />

Function Distribution Link Inverse Link v(µ)<br />

normal Multi. Normal Identity η R = {σ ij }<br />

normal log Multi. Normal Identity η R = exp({σ ij })<br />

logit Binomial/n Logit e η /(1 + e η ) µ(1 − µ)/n<br />

probit Probit Φ(η)<br />

cloglog Complementary log-log 1 − exp(− exp(η))<br />

thresh Multinomial Threshold Pr(η + τ i−1 < Z ≤ η + τ i ) Diag(µ) − µµ ′<br />

poisson Poisson Log e η µ<br />

weibull Weibull<br />

richards Richards Growth Function η 1 (1 ± e −η3(t−tη2) ) η4 σ 2<br />

11.1.2 Maximum Likelihood Estimates<br />

For generalized linear mixed models, estimates of the fixed effects are obtained by iteratively solving<br />

(<br />

X ′ H ′ R −1 HX ) ̂β =<br />

(<br />

X ′ H ′ R −1 y∗ ) (11.1)<br />

where<br />

H = ∂µ<br />

∂η ′<br />

R = Var(y)<br />

y∗ = y − µ + Hη.<br />

The M.glim() member function can be used to iteratively solve (11.1) and returns a vector of the estimated<br />

effects. With no arguments M.glim() performs 10 iterations. In this case, we will perform 20 iterations by<br />

using<br />

M.glim(20);<br />

Convergence can be checked by comparing the current log likelihood<br />

"Log Like " L=M.log_like()<br />

with the log likelihood after a few additional iterations<br />

bhat=M.glim(5);<br />

"Change in Log Like " (M.log_like()-L)<br />

where the vector bhat contains the estimated effects. The resulting output:<br />

Log Like<br />

-32.1018<br />

Change in Log Like<br />

0<br />

indicating that the algorithm did in fact converge.<br />

11.1.3 Estimation and Testing<br />

As with linear models estimates of K ′ β can be obtained using M.estimate(Kp), where Kp is K ′ . For example<br />

to estimate the effect of formulation:

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

Saved successfully!

Ooh no, something went wrong!