Chapter 14 Computing: McCulloch, CE, Searle SR and Neuhaus, JM 2008. Generalized, Linear and Mixed Models. John Wiley & Sons, New York. Second Edition.

Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Chapter 14: Computing
Generalized, Linear, and Mixed Models
Charles E. McCulloch, Shayle R. Searle, John M. Neuhaus

Gota Morota

May 4, 2010

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Outline

1

Review of LM, GLM, LMM, GLMM

2

Numerical Integration for Solving GLMM

3

GLMM in R

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Linear Model and Linear Mixed Model
LM: Solving the MLE with a least squares for fixed effects and
simple formula for estimating residual variance.

ˆ
B = (X X)−1 X y
RSS
σ2 =
ˆe
N−p
LMM Solving the MLE with a least squares for the fixed effects
and random effects. Solving the MLE with a (RE)ML for the
variance components.

ˆ
B = (X V−1 X)X V−1 y
ˆ
u = DZ V−1 (y − XB)
Variance Components = (RE)ML coupled with iterative methods
where D is Var(u), V is Var(y) = ZDZ + R
Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Generalized Linear Model and Generalized Linear Mixed
Model
GLM: Fixed effects are estimated by solving the MLE
(nonlinear) with an iterative reweighted least squares such as
Fisher Scoring.
Bm+1 = Bm + (X WX)−1 X W∆(y − u)
where ui = g −1 (xi B ), g (ui ) = xi B, ∆ = {gu (ui )}, W = {wi },
2
wi = [υ(ui )gu (ui )]−1
GLMM Requires high dimensional integration to evaluate and
maximizing the likelihood cannot be computed explicitly
(hence not able to solve iteratively like GLM)
L=

fYi |u (yi |u)fU (u)du
i

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Outline

1

Review of LM, GLM, LMM, GLMM

2

Numerical Integration for Solving GLMM

3

GLMM in R

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Numerical Integration

Numerical Integration
Method for numerically approximating the value of a definite
integral
b

f (x )dx
a

Numerical integration for one-dimensional integrals
Rectangle rule
Trapezoidal rule
Simpson’s rule

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Trapezoidal Rule
b

f (x )dx =

a

b −a
(f (x0 ) + 2f (x1 ) + 2f (x2 ) · · · + 2f (xn−1 ) + f (xn ))
2n

where
xk = a + k

b −a
n

for k = 0, 1, · · · , n

Figure 1: From Wikipedia http://en.wikipedia.org/wiki/Trapezoidal rule

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Evaluation of the Integrals

There are various methods to do this:

Approximating the integral
Gauss-Hermite Quadrature
Laplace Approximation
Adaptive Gauss-Hermite Quadrature

Approximating the data
Penalized Quasi-Likelihood

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Gauss-Hermite Quadrature I
yij |u ∼ indep. fYij |U (yij |u)
fYij |U (yij |u) = exp([yij γij − b (γij )]/γ2 − c (yij , γ))
E [yij |u] = µij
g (µij ) = xij B + ui , ui ∼ i.i.d. N (0, σ2 )
u
L=

fYij |Ui (yij |ui )fUi (ui )dui
i ,j

∞

=

e
i

j [yij γij −b (γij )]γ

−

j

c (yij ,γ) e

=

−ui2 /(2σ2 )
u

2πσ2
u

−∞

e −ui /(2σu )
2

∞

hi (ui )
i

2

−∞
Gota Morota

2

2πσ2
u

dui

Chapter 14: Computing

dui
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Gauss-Hermite Quadrature II
It be can seen that the likelihood is the product of one-dimensional
integrals of the form:
∞

h (u )

√

2

/(2σ2 )
u

du

2πσ2
u

−∞

changing u to

e −u

2σu υ gives:

∞

2

e −υ

∞

π

√

−∞

h ( 2σu υ) √ dυ ≡
−∞

√

√

where h ∗ (·) ≡ h ( 2σu ·)/ π
Gota Morota

2

h ∗ (υ)e −υ dυ

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Gauss-Hermite Quadrature III

Gauss-Hermite quadrature approximates the integral as a
weighted sum:
d

∞
∗

h (υ)e

−υ2

−∞

h ∗ (xk )wk

dυ
k =1

where wk is the weights, and the evaluation points, xk , are
designed to provide an accurate approximation in the case where
h ∗ (·) is a polynomial.

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Constants for Gauss-Hermite Quadrature
Table 1: xk and wk for d = 3

d=3

xk
-1.22474487
0
1.22474487

wk
0.29540898
1.18163590
0.29540898

Formula for xk and wk
xk = ith zero of Hn (x )

√

wk =

2n−1 n! π
n2 [Hn−1 (xk )]2

Chapter 14: Computing
Gota polynomial of degree n.
where Hn (x ) is the Hermite Morota
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Gauss-Hermite Quadrature IV

Example
Approximation of integral using 3-point quadrature:
∞

2

(1 + x 2 )e −x dx

(1 + [−1.22474]2 )(0.29541)

−∞

+ (1 + 02 )(1.18164) + (1 + 1.224742 )(0.29541)
= 2.65868

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Other Approximation Methods

Laplace Approximation
1

2
3
4

find a peak xpeak of the given integrand f (x ) by taking a
derivative
apply a second-order Taylor series expansion around this peak
calculate the variance σ = 1/f (xpeak )
approximate the f (x ) ∼ N (xk , σ2 )

Adaptive Gauss-Hermite Quadrature
1
apply centralization of the f (x ) about zero or standardization
Penalize-Quasi Likelihood
1

approximate the likelihood itself

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Outline

1

Review of LM, GLM, LMM, GLMM

2

Numerical Integration for Solving GLMM

3

GLMM in R

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

GLMM in R

Table 2: GLMM in R

glmmPQL (1)
glmmML (2)
glmer (3)
MCMCglmm (4)
1
2

Package
MASS
glmmML
lme4
MCMCglmm

Random Effect
intercept/coef
intercept
intercept/coef
intercept/coef

Computing Method
PQL 1
Laplace/AGQ 2
Laplace/AGQ 2
MCMC

Approximation to the likelihood
Numerical Integration

Numerical Integration & approximation to the likelihood
Can be used in Likelihood-based methods (1-3) or bayesian
approach (4) for obtaining the unknown parameters.
Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Simulation

PQL

AGQ

0.2

0.5

1.0

1.5

0.4

0.6

0.8

1.0

2.0

Laplace

pi =

1
1 + exp (−(4 + xi + γi ))

γ ∼ N (0, 32 )
0.5

1.0

1.5

2.0

Gota Morota

Chapter 14: Computing
Review of LM, GLM, LMM, GLMM
Numerical Integration for Solving GLMM
GLMM in R

Summary

AGQ: produces greater accuracy in the evaluation of the
log-likelihood
Laplace: special case of AGQ
PQL: typically ends up in biased estimates
Difficulty dealing with more complicated models

⇓
MCMC?

Gota Morota

Chapter 14: Computing
1 of 18

Recommended

Lesson 7: Vector-valued functions by
Lesson 7: Vector-valued functionsLesson 7: Vector-valued functions
Lesson 7: Vector-valued functionsMatthew Leingang
5.1K views33 slides
Ece4510 notes10 by
Ece4510 notes10Ece4510 notes10
Ece4510 notes10K. M. Shahrear Hyder
472 views12 slides
D I G I T A L C O N T R O L S Y S T E M S J N T U M O D E L P A P E R{Www by
D I G I T A L  C O N T R O L  S Y S T E M S  J N T U  M O D E L  P A P E R{WwwD I G I T A L  C O N T R O L  S Y S T E M S  J N T U  M O D E L  P A P E R{Www
D I G I T A L C O N T R O L S Y S T E M S J N T U M O D E L P A P E R{Wwwguest3f9c6b
793 views8 slides
Ece4510 notes09 by
Ece4510 notes09Ece4510 notes09
Ece4510 notes09K. M. Shahrear Hyder
130 views21 slides
Algorithum Analysis by
Algorithum AnalysisAlgorithum Analysis
Algorithum AnalysisAin-ul-Moiz Khawaja
756 views24 slides
Laplace table by
Laplace tableLaplace table
Laplace tableThapar University
388.1K views2 slides

More Related Content

What's hot

Control chap10 by
Control chap10Control chap10
Control chap10Mohd Ashraf Shabarshah
8.5K views42 slides
002 ray modeling dynamic systems by
002 ray modeling dynamic systems002 ray modeling dynamic systems
002 ray modeling dynamic systemsInstitute of Technology Telkom
842 views24 slides
[DL輪読会]陰関数微分を用いた深層学習 by
[DL輪読会]陰関数微分を用いた深層学習[DL輪読会]陰関数微分を用いた深層学習
[DL輪読会]陰関数微分を用いた深層学習Deep Learning JP
3.1K views43 slides
Linear transformations-thestuffpoint.com by
Linear transformations-thestuffpoint.comLinear transformations-thestuffpoint.com
Linear transformations-thestuffpoint.comAbu Bakar Soomro
1.1K views10 slides
Asymptotic notation by
Asymptotic notationAsymptotic notation
Asymptotic notationSaranya Natarajan
2.8K views12 slides
Simulation And Modelling by
Simulation And ModellingSimulation And Modelling
Simulation And ModellingAbhishek Chandra
161 views42 slides

What's hot(17)

[DL輪読会]陰関数微分を用いた深層学習 by Deep Learning JP
[DL輪読会]陰関数微分を用いた深層学習[DL輪読会]陰関数微分を用いた深層学習
[DL輪読会]陰関数微分を用いた深層学習
Deep Learning JP3.1K views
Linear transformations-thestuffpoint.com by Abu Bakar Soomro
Linear transformations-thestuffpoint.comLinear transformations-thestuffpoint.com
Linear transformations-thestuffpoint.com
Abu Bakar Soomro1.1K views
Master method by arun jacob
Master methodMaster method
Master method
arun jacob2.3K views
Context-Aware Recommender System Based on Boolean Matrix Factorisation by Dmitrii Ignatov
Context-Aware Recommender System Based on Boolean Matrix FactorisationContext-Aware Recommender System Based on Boolean Matrix Factorisation
Context-Aware Recommender System Based on Boolean Matrix Factorisation
Dmitrii Ignatov884 views
Simulation of a_pmsm_motor_control_system by maheshwareshwar
Simulation of a_pmsm_motor_control_systemSimulation of a_pmsm_motor_control_system
Simulation of a_pmsm_motor_control_system
maheshwareshwar1.7K views
Differential equation & laplace transformation with matlab by Ravi Jindal
Differential equation & laplace transformation with matlabDifferential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlab
Ravi Jindal11K views
Master theorem by fika sweety
Master theoremMaster theorem
Master theorem
fika sweety4.4K views
Signal Flow Graph ( control system) by Gourab Ghosh
Signal Flow Graph ( control system)Signal Flow Graph ( control system)
Signal Flow Graph ( control system)
Gourab Ghosh1.1K views
inverse z-transform ppt by mihir jain
inverse z-transform pptinverse z-transform ppt
inverse z-transform ppt
mihir jain10.2K views
digital control Chapter 2 slide by asyrafjpk
digital control Chapter 2 slidedigital control Chapter 2 slide
digital control Chapter 2 slide
asyrafjpk6.2K views

Viewers also liked

Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq... by
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Gota Morota
438 views15 slides
Chapter 12 Application of Gibbs Sampling in Variance Component Estimation and... by
Chapter 12 Application of Gibbs Sampling in Variance Component Estimation and...Chapter 12 Application of Gibbs Sampling in Variance Component Estimation and...
Chapter 12 Application of Gibbs Sampling in Variance Component Estimation and...Gota Morota
484 views18 slides
Catalogo.pdf meridional by
Catalogo.pdf meridionalCatalogo.pdf meridional
Catalogo.pdf meridionalGiacomo Furriel
3.4K views44 slides
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq... by
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Gota Morota
417 views46 slides
Whole-genome prediction of complex traits using kernel methods by
Whole-genome prediction of complex traits using kernel methodsWhole-genome prediction of complex traits using kernel methods
Whole-genome prediction of complex traits using kernel methodsGota Morota
1.1K views31 slides
How to Become a Thought Leader in Your Niche by
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
1.6M views13 slides

Viewers also liked(6)

Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq... by Gota Morota
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Gota Morota438 views
Chapter 12 Application of Gibbs Sampling in Variance Component Estimation and... by Gota Morota
Chapter 12 Application of Gibbs Sampling in Variance Component Estimation and...Chapter 12 Application of Gibbs Sampling in Variance Component Estimation and...
Chapter 12 Application of Gibbs Sampling in Variance Component Estimation and...
Gota Morota484 views
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq... by Gota Morota
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Application of Bayesian and Sparse Network Models for Assessing Linkage Diseq...
Gota Morota417 views
Whole-genome prediction of complex traits using kernel methods by Gota Morota
Whole-genome prediction of complex traits using kernel methodsWhole-genome prediction of complex traits using kernel methods
Whole-genome prediction of complex traits using kernel methods
Gota Morota1.1K views
How to Become a Thought Leader in Your Niche by Leslie Samuel
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel1.6M views

Similar to Chapter 14 Computing: McCulloch, CE, Searle SR and Neuhaus, JM 2008. Generalized, Linear and Mixed Models. John Wiley & Sons, New York. Second Edition.

hankel_norm approximation_fir_ ijc by
hankel_norm approximation_fir_ ijchankel_norm approximation_fir_ ijc
hankel_norm approximation_fir_ ijcVasilis Tsoulkas
205 views15 slides
Asymtotic Appoach.ppt by
Asymtotic Appoach.pptAsymtotic Appoach.ppt
Asymtotic Appoach.pptSherylArulini1
6 views39 slides
02-asymp.ppt by
02-asymp.ppt02-asymp.ppt
02-asymp.pptAnikGhosh44
11 views39 slides
MM framework for RL by
MM framework for RLMM framework for RL
MM framework for RLSung Yub Kim
1K views26 slides
SIAM_QMC_Fourier_Pricing_Pres.pdf by
SIAM_QMC_Fourier_Pricing_Pres.pdfSIAM_QMC_Fourier_Pricing_Pres.pdf
SIAM_QMC_Fourier_Pricing_Pres.pdfMichaelSamet4
29 views35 slides
02 asymp by
02 asymp02 asymp
02 asympaparnabk7
860 views39 slides

Similar to Chapter 14 Computing: McCulloch, CE, Searle SR and Neuhaus, JM 2008. Generalized, Linear and Mixed Models. John Wiley & Sons, New York. Second Edition.(20)

SIAM_QMC_Fourier_Pricing_Pres.pdf by MichaelSamet4
SIAM_QMC_Fourier_Pricing_Pres.pdfSIAM_QMC_Fourier_Pricing_Pres.pdf
SIAM_QMC_Fourier_Pricing_Pres.pdf
MichaelSamet429 views
02 asymp by aparnabk7
02 asymp02 asymp
02 asymp
aparnabk7860 views
Fuzzy logic based mrac for a second order system by IAEME Publication
Fuzzy logic based mrac for a second order systemFuzzy logic based mrac for a second order system
Fuzzy logic based mrac for a second order system
IAEME Publication235 views
Fuzzy logic based mrac for a second order system by IAEME Publication
Fuzzy logic based mrac for a second order systemFuzzy logic based mrac for a second order system
Fuzzy logic based mrac for a second order system
IAEME Publication259 views
Charged Lepton Flavour Violation in Left-Right Symmetric Model by Samim Ul Islam
Charged Lepton Flavour Violation in Left-Right Symmetric ModelCharged Lepton Flavour Violation in Left-Right Symmetric Model
Charged Lepton Flavour Violation in Left-Right Symmetric Model
Samim Ul Islam27 views
Generalized Nonlinear Models in R by htstatistics
Generalized Nonlinear Models in RGeneralized Nonlinear Models in R
Generalized Nonlinear Models in R
htstatistics1.9K views
Bayesian Inference and Uncertainty Quantification for Inverse Problems by Matt Moores
Bayesian Inference and Uncertainty Quantification for Inverse ProblemsBayesian Inference and Uncertainty Quantification for Inverse Problems
Bayesian Inference and Uncertainty Quantification for Inverse Problems
Matt Moores159 views
DUALITY THEORY FOR COMPOSITE GEOMETRIC PROGRAMMING by Ya-Ping Wang
DUALITY THEORY FOR COMPOSITE GEOMETRIC PROGRAMMINGDUALITY THEORY FOR COMPOSITE GEOMETRIC PROGRAMMING
DUALITY THEORY FOR COMPOSITE GEOMETRIC PROGRAMMING
Ya-Ping Wang216 views
Numerical analysis m2 l4slides by SHAMJITH KM
Numerical analysis  m2 l4slidesNumerical analysis  m2 l4slides
Numerical analysis m2 l4slides
SHAMJITH KM667 views

Recently uploaded

Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...ShapeBlue
108 views12 slides
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueShapeBlue
139 views15 slides
Generative AI: Shifting the AI Landscape by
Generative AI: Shifting the AI LandscapeGenerative AI: Shifting the AI Landscape
Generative AI: Shifting the AI LandscapeDeakin University
67 views55 slides
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...The Digital Insurer
91 views52 slides
Future of AR - Facebook Presentation by
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook PresentationRob McCarty
65 views27 slides
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsShapeBlue
247 views13 slides

Recently uploaded(20)

Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue108 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue139 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty65 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue247 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc176 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash162 views
Optimizing Communication to Optimize Human Behavior - LCBM by Yaman Kumar
Optimizing Communication to Optimize Human Behavior - LCBMOptimizing Communication to Optimize Human Behavior - LCBM
Optimizing Communication to Optimize Human Behavior - LCBM
Yaman Kumar38 views
LLMs in Production: Tooling, Process, and Team Structure by Aggregage
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team Structure
Aggregage57 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu437 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue171 views
"Package management in monorepos", Zoltan Kochan by Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays34 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue225 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue303 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue162 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue207 views
Initiating and Advancing Your Strategic GIS Governance Strategy by Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software184 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays58 views

Chapter 14 Computing: McCulloch, CE, Searle SR and Neuhaus, JM 2008. Generalized, Linear and Mixed Models. John Wiley & Sons, New York. Second Edition.

  • 1. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Chapter 14: Computing Generalized, Linear, and Mixed Models Charles E. McCulloch, Shayle R. Searle, John M. Neuhaus Gota Morota May 4, 2010 Gota Morota Chapter 14: Computing
  • 2. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Outline 1 Review of LM, GLM, LMM, GLMM 2 Numerical Integration for Solving GLMM 3 GLMM in R Gota Morota Chapter 14: Computing
  • 3. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Linear Model and Linear Mixed Model LM: Solving the MLE with a least squares for fixed effects and simple formula for estimating residual variance. ˆ B = (X X)−1 X y RSS σ2 = ˆe N−p LMM Solving the MLE with a least squares for the fixed effects and random effects. Solving the MLE with a (RE)ML for the variance components. ˆ B = (X V−1 X)X V−1 y ˆ u = DZ V−1 (y − XB) Variance Components = (RE)ML coupled with iterative methods where D is Var(u), V is Var(y) = ZDZ + R Gota Morota Chapter 14: Computing
  • 4. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Generalized Linear Model and Generalized Linear Mixed Model GLM: Fixed effects are estimated by solving the MLE (nonlinear) with an iterative reweighted least squares such as Fisher Scoring. Bm+1 = Bm + (X WX)−1 X W∆(y − u) where ui = g −1 (xi B ), g (ui ) = xi B, ∆ = {gu (ui )}, W = {wi }, 2 wi = [υ(ui )gu (ui )]−1 GLMM Requires high dimensional integration to evaluate and maximizing the likelihood cannot be computed explicitly (hence not able to solve iteratively like GLM) L= fYi |u (yi |u)fU (u)du i Gota Morota Chapter 14: Computing
  • 5. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Outline 1 Review of LM, GLM, LMM, GLMM 2 Numerical Integration for Solving GLMM 3 GLMM in R Gota Morota Chapter 14: Computing
  • 6. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Numerical Integration Numerical Integration Method for numerically approximating the value of a definite integral b f (x )dx a Numerical integration for one-dimensional integrals Rectangle rule Trapezoidal rule Simpson’s rule Gota Morota Chapter 14: Computing
  • 7. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Trapezoidal Rule b f (x )dx = a b −a (f (x0 ) + 2f (x1 ) + 2f (x2 ) · · · + 2f (xn−1 ) + f (xn )) 2n where xk = a + k b −a n for k = 0, 1, · · · , n Figure 1: From Wikipedia http://en.wikipedia.org/wiki/Trapezoidal rule Gota Morota Chapter 14: Computing
  • 8. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Evaluation of the Integrals There are various methods to do this: Approximating the integral Gauss-Hermite Quadrature Laplace Approximation Adaptive Gauss-Hermite Quadrature Approximating the data Penalized Quasi-Likelihood Gota Morota Chapter 14: Computing
  • 9. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Gauss-Hermite Quadrature I yij |u ∼ indep. fYij |U (yij |u) fYij |U (yij |u) = exp([yij γij − b (γij )]/γ2 − c (yij , γ)) E [yij |u] = µij g (µij ) = xij B + ui , ui ∼ i.i.d. N (0, σ2 ) u L= fYij |Ui (yij |ui )fUi (ui )dui i ,j ∞ = e i j [yij γij −b (γij )]γ − j c (yij ,γ) e = −ui2 /(2σ2 ) u 2πσ2 u −∞ e −ui /(2σu ) 2 ∞ hi (ui ) i 2 −∞ Gota Morota 2 2πσ2 u dui Chapter 14: Computing dui
  • 10. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Gauss-Hermite Quadrature II It be can seen that the likelihood is the product of one-dimensional integrals of the form: ∞ h (u ) √ 2 /(2σ2 ) u du 2πσ2 u −∞ changing u to e −u 2σu υ gives: ∞ 2 e −υ ∞ π √ −∞ h ( 2σu υ) √ dυ ≡ −∞ √ √ where h ∗ (·) ≡ h ( 2σu ·)/ π Gota Morota 2 h ∗ (υ)e −υ dυ Chapter 14: Computing
  • 11. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Gauss-Hermite Quadrature III Gauss-Hermite quadrature approximates the integral as a weighted sum: d ∞ ∗ h (υ)e −υ2 −∞ h ∗ (xk )wk dυ k =1 where wk is the weights, and the evaluation points, xk , are designed to provide an accurate approximation in the case where h ∗ (·) is a polynomial. Gota Morota Chapter 14: Computing
  • 12. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Constants for Gauss-Hermite Quadrature Table 1: xk and wk for d = 3 d=3 xk -1.22474487 0 1.22474487 wk 0.29540898 1.18163590 0.29540898 Formula for xk and wk xk = ith zero of Hn (x ) √ wk = 2n−1 n! π n2 [Hn−1 (xk )]2 Chapter 14: Computing Gota polynomial of degree n. where Hn (x ) is the Hermite Morota
  • 13. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Gauss-Hermite Quadrature IV Example Approximation of integral using 3-point quadrature: ∞ 2 (1 + x 2 )e −x dx (1 + [−1.22474]2 )(0.29541) −∞ + (1 + 02 )(1.18164) + (1 + 1.224742 )(0.29541) = 2.65868 Gota Morota Chapter 14: Computing
  • 14. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Other Approximation Methods Laplace Approximation 1 2 3 4 find a peak xpeak of the given integrand f (x ) by taking a derivative apply a second-order Taylor series expansion around this peak calculate the variance σ = 1/f (xpeak ) approximate the f (x ) ∼ N (xk , σ2 ) Adaptive Gauss-Hermite Quadrature 1 apply centralization of the f (x ) about zero or standardization Penalize-Quasi Likelihood 1 approximate the likelihood itself Gota Morota Chapter 14: Computing
  • 15. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Outline 1 Review of LM, GLM, LMM, GLMM 2 Numerical Integration for Solving GLMM 3 GLMM in R Gota Morota Chapter 14: Computing
  • 16. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R GLMM in R Table 2: GLMM in R glmmPQL (1) glmmML (2) glmer (3) MCMCglmm (4) 1 2 Package MASS glmmML lme4 MCMCglmm Random Effect intercept/coef intercept intercept/coef intercept/coef Computing Method PQL 1 Laplace/AGQ 2 Laplace/AGQ 2 MCMC Approximation to the likelihood Numerical Integration Numerical Integration & approximation to the likelihood Can be used in Likelihood-based methods (1-3) or bayesian approach (4) for obtaining the unknown parameters. Gota Morota Chapter 14: Computing
  • 17. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Simulation PQL AGQ 0.2 0.5 1.0 1.5 0.4 0.6 0.8 1.0 2.0 Laplace pi = 1 1 + exp (−(4 + xi + γi )) γ ∼ N (0, 32 ) 0.5 1.0 1.5 2.0 Gota Morota Chapter 14: Computing
  • 18. Review of LM, GLM, LMM, GLMM Numerical Integration for Solving GLMM GLMM in R Summary AGQ: produces greater accuracy in the evaluation of the log-likelihood Laplace: special case of AGQ PQL: typically ends up in biased estimates Difficulty dealing with more complicated models ⇓ MCMC? Gota Morota Chapter 14: Computing