matU {saeRobust}R Documentation

Matrix constructor functions

Description

These functions construct different parts of matrix components. They are used internally. If you are interested in the weights of a model fitted using rfh please try to use weights.fitrfh on that object.

Usage

matU(.V)

matTrace(x)

matB(y, X, beta, re, matV, psi)

matBConst(y, X, beta, matV, psi)

matA(y, X, beta, matV, psi)

matAConst(y, X, matV, psi)

matW(y, X, beta, re, matV, psi)

matWbc(y, reblup, W, samplingVar, c = 1)

matTZ(.nDomains, .nTime)

matTZ1(.nDomains = 10, .nTime = 10)

Arguments

.V

(Matrix) variance matrix

x

([m|M]atrix) a matrix

y

(numeric) response

X

(Matrix) design matrix

beta

(numeric) vector of regression coefficients

re

(numeric) vector of random effects

matV

(list of functions) see matVFH for an example

psi

(function) the influence function

reblup

(numeric) vector with robust best linear unbiased predictions

W

(Matrix) the weighting matrix

samplingVar

(numeric) the vector of sampling variances

c

(numeric) scalar

.nDomains

(integer) number of domains

.nTime

(integer) number of time periods

Details

matU computes U. U is the matrix containing only the diagonal elements of V. This function returns a list of functions which can be called to compute specific transformations of U.

matTrace computes the trace of a matrix.

matB computes the matrix B which is used to compute the weights in the pseudo linearised representation of the REBLUP.

matBConst returns a function with one argument, u, to compute the matrix B. This function is used internally to compute B in the fixed point algorithm.

matA computes the matrix A which is used to compute the weights in the pseudo linearized representation of the REBLUP.

matAConst returns a function with one argument, beta, to compute the matrix A. This function is used internally to compute A in the fixed point algorithm for beta.

matW returns a matrix containing the weights as they are defined for the pseudo linear form, such that matW %*% y is the REBLUP.

matWbc returns a matrix containing the weights as they are defined for the pseudo linear form, such that matWbc %*% y is the bias-corrected REBLUP. c is a multiplyer for the standard deviation.

matTZ constructs the Z matrix in a linear mixed model with autocorrelated random effects.

matTZ1 constructs the Z1 matrix in a linear mixed model with autocorrelated random effects.

References

Warnholz, S. (2016): "Small Area Estimaiton Using Robust Extension to Area Level Models". Not published (yet).

Examples

data("grapes", package = "sae")
data("grapesprox", package = "sae")

fitRFH <- rfh(
  grapehect ~ area + workdays - 1,
  data = grapes,
  samplingVar = "var"
)

matV <- variance(fitRFH)

# matU:
matU(matV$V())$U()
matU(matV$V())$sqrt()
matU(matV$V())$sqrtInv()

# matB (and matA + matW accordingly):
matB(
  fitRFH$y,
  fitRFH$x,
  fitRFH$coefficients,
  fitRFH$re,
  matV,
  function(x) psiOne(x, k = fitRFH$k)
)

matBConst(
  fitRFH$y,
  fitRFH$x,
  fitRFH$coefficients,
  matV,
  function(x) psiOne(x, k = fitRFH$k)
)(fitRFH$re)

# construcors for 'Z' in linear mixed models
matTZ(2, 3)
matTZ1(2, 3)

[Package saeRobust version 0.5.0 Index]