Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: glm
See also: glmbilo glmbipro glmnoid glmest glmstat eigsm

Macro: glmdiagh
Description: glmdiagh calculates the diagonal elements of the 'hat' matrix

Link:
Usage: h = glmdiagh(bv,x{,w})
Input:
bv p x p matrix, the estimated covariance matrix for the coefficients.
x n x p matrix, the matrix of (observed) regressor variables.
w optional, n x 1 matrix, the weights used to estimate the coefficients.
Output:
h n x 1 matrix, the diagonal elements of the `hat' matrix: W'^(1/2)X(X'WX)^(-1) X'W^(1/2).

Example:
library("glm")
n = 100
b = 2|(-1) 
x = normal(n,rows(b))
m = ceil(uniform(n).*5) 
{y,p} = genbilo(x,b,m)
opt=glmopt("wx",m)             
l = glmbilo(x,y,opt)
h = glmdiagh(l.bv,x,l.w)          
Result:
Vector of diagonal elements of the hat matrix.

Library: glm
See also: glmbilo glmbipro glmnoid glmest glmstat eigsm

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: Berwin Turlach, 921215 & Marlene Mueller, 970523
(C) MD*TECH Method and Data Technologies, 28.6.1999