R/hatfun.R

Defines functions hatfun

Documented in hatfun

hatfun <- function(x,g)
# Calculate the hat matrix.
{
	Q  <- x%*%solve(t(x)%*%(g*x))%*%t(g*x)
	1 + diag(t(Q)%*%Q - Q - t(Q))
}

Try the mixreg package in your browser

Any scripts or data that you put into this service are public.

mixreg documentation built on Oct. 14, 2021, 9:12 a.m.