Learn R Programming

saeRobust (version 0.1.0)

fitrfh: Fitting Precedures

Description

Several fitting procedures. The arguments can be passed to these functions using the interface in rfh. The functions here listed are the low level implementations and are not intended for interactive use.

Usage

fitrfh(y, x, samplingVar, ...)
fitrsfh(y, x, samplingVar, W, x0Var = c(0.01, 1), ...)
fitrtfh(y, x, samplingVar, nTime, x0Var = c(0.01, 1, 1), ...)
fitrstfh(y, x, samplingVar, W, nTime, x0Var = c(0.01, 0.01, 1, 1), ...)
fitGenericModel(y, x, matVFun, fixedPointParam, k = 1.345, K = getK(k), x0Coef = NULL, x0Var = 1, x0Re = NULL, tol = 1e-06, maxIter = 100, maxIterParam = 10, maxIterRe = 100, convCrit = convCritRelative(tol), ...)
"rfh"(formula, data, samplingVar, correlation = NULL, ...)
"rfh"(formula, data, samplingVar, correlation = NULL, ...)
"rfh"(formula, data, samplingVar, correlation = NULL, ...)
"rfh"(formula, data, samplingVar, correlation = NULL, ...)

Arguments

y
(numeric) response vector
x
([m|M]atrix) the design matrix
samplingVar
(numeric) vector with sampling variances
...
arguments passed to fitGenericModel
W
(matrix) proximity matrix
x0Var
(numeric) starting values for variance parameters
nTime
(integer) number of time periods
matVFun
(function) a function with one argument - the variance parameters - constructing something like variance
fixedPointParam
(function) a function with one argument. The vector of model parameters. Returns a list of results of the next iteration in the overall algorithm.
k
(numeric) tuning constant
K
(numeric) scaling constant
x0Coef
(numeric) starting values for regression coefficients
x0Re
(numeric) starting values for random effects
tol
(numeric) numerical toloerance to be used during optimisation
maxIter
(integer) the maximum number of iterations for model parameters.
maxIterParam
(integer) the maximum number of iterations for each parameter in each overall iteration
maxIterRe
(integer) the maximum number of iterations for fitting the random effects
convCrit
(function) a function defining the stopping rule
formula
(formula) a formula specifying the fixed effects part of the model.
data
(data.frame) a data set.
correlation
an optional correlation structure, e.g. corSAR1, for the random effects part of the model. Default is no correlation, i.e. a random intercept.

Details

fitrfh implements the robust Fay-Herriot model; fitrsfh the spatial, fitrtfh the temporal, and fitrstfh the spatio-temporal extension to this model type. See rfh how to fit such models. fitGenericModel is used by all these implementations and can be used for possible extensions of the framework.

Examples

Run this code
data(milk, package = "sae")
x <- matrix(1, nrow = NROW(milk))
y <- milk$yi
samplingVar <- milk$SD^2
fitrfh(y, x, samplingVar)

Run the code above in your browser using DataLab