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.
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),
...
)
# S4 method for numeric,matrixORMatrix,numeric,`NULL`
rfh(formula, data, samplingVar, correlation = NULL, ...)
# S4 method for numeric,matrixORMatrix,numeric,corSAR1
rfh(formula, data, samplingVar, correlation = NULL, ...)
# S4 method for numeric,matrixORMatrix,numeric,corAR1
rfh(formula, data, samplingVar, correlation = NULL, ...)
# S4 method for numeric,matrixORMatrix,numeric,corSAR1AR1
rfh(formula, data, samplingVar, correlation = NULL, ...)
(numeric) response vector
([m|M]atrix) the design matrix
(numeric) vector with sampling variances
arguments passed to fitGenericModel
(matrix) proximity matrix
(numeric) starting values for variance parameters
(integer) number of time periods
(function) a function with one argument - the variance parameters - constructing something like variance
(function) a function with one argument. The vector of model parameters. Returns a list of results of the next iteration in the overall algorithm.
(numeric) tuning constant
(numeric) scaling constant
(numeric) starting values for regression coefficients
(numeric) starting values for random effects
(numeric) numerical toloerance to be used during optimisation
(integer) the maximum number of iterations for model parameters.
(integer) the maximum number of iterations for each parameter in each overall iteration
(integer) the maximum number of iterations for fitting the random effects
(function) a function defining the stopping rule
(formula) a formula specifying the fixed effects part of the model.
(data.frame) a data set.
an optional correlation structure, e.g. corSAR1, for the random effects part of the model. Default is no correlation, i.e. a random intercept.
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.
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