fitsaemodel: Fitting SAE Models

View source: R/fitsaemodel.R

fitsaemodelR Documentation

Fitting SAE Models

Description

fitsaemodel fits SAE models that have been specified by saemodel() (or synthetic data generated by makedata()) for various (robust) estimation methods.

Usage

fitsaemodel(method, model, ...)
convergence(object)

## S3 method for class 'fit_model_b'
print(x, digits = max(3L, getOption("digits") - 3L),
    ...)
## S3 method for class 'summary_fit_model_b'
print(x, digits = max(3L, getOption("digits")
    - 3L), ...)
## S3 method for class 'fit_model_b'
summary(object, ...)
## S3 method for class 'fit_model_b'
coef(object, type = "both", ...)

Arguments

method

[character] estimation method; method = "ml" for (non-robust) maximum likelihood or method = "huberm" for Huber-type M-estimation.

model

an object of class "saemodel", i.e., a SAE model; see saemodel().

digits

[integer] number of digits printed by the print() and summary() methods.

object

an object of class "fit_model_b".

x

an object of class "fit_model_b".

type

[character] name effects to be extracted by the coef method; it can take one of the following possibilities: "both" (extracts fixed and random effects; default), "ranef" (only random effects), or "fixef" (only fixed effects).

...

additional arguments passed on to fitsaemodel.control().

Details

Function fitsaemodel() computes the following estimators:

  • maximum likelihood (ML): method = "ml",

  • Huber-type M-estimation: method = "huberm"; this method is called RML II by Richardson and Welsh (1995); see Schoch (2012)

Maximum likelihood

The ML is not robust against outliers.

Huber-type M-estimation

The call for the Huber-type M-estimator (with Huber psi-function) is: fitsaemodel(method = "huberm", model, k), where k is the robustness tuning constant of the Huber psi-function, k in (0, Inf].

By default, the computation of the M-estimator is initialized by a robust estimate that derives from a fixed-effects model (centered by the median instead of the mean); see Schoch (2012) for the details.

If the data are supposed to be heavily contaminated (or if the default algorithm did not converge), one may try to initialize the algorithm underlying fitsaemodel() by a high breakdown-point estimate. The package offers two initialization methods: NOTE: the robustbase package (Maechler et al., 2022) must be installed to use this functionality.

  • init = "lts": least trimmed squares (LTS) regression from robustbase; see ltsReg() and Rousseeuw and Van Driessen (2006),

  • init = "s": regression S-estimator from robustbase; see lmrob() and Maronna et al. (2019).

For small and medium size datasets, both methods are equivalent in terms of computation time. For large data, the S-estimator is considerably faster.

Implementation

The methods are computed by (nested) iteratively re-weighted least squares and Brent's zeroin method (Brent, 1973). The functions depend on the subroutines in BLAS (Blackford et al., 2002) and LAPACK (Anderson et al., 2000); see Schoch (2012).

Value

An instance of the class "fitmodel"

References

Anderson, E., Bai, Z., Bischof, C., Blackford, L. S., Demmel, J., Dongarra, J., et al. (2000). LAPACK users' guide (3rd ed.). Philadelphia: Society for Industrial and Applied Mathematics (SIAM).

Blackford, L.S., Petitet, A., Pozo, R., Remington, K., Whaley, R.C., Demmel, J., et al. (2002). An updated set of basic linear algebra subprograms (BLAS). ACM Transactions on Mathematical Software 28, 135–151. doi: 10.1145/567806.567807

Brent, R.P. (1973). Algorithms for minimization without derivatives. Englewood Cliffs, NJ: Prentice-Hall.

Maechler, M., Rousseeuw, P., Croux, C., Todorov, V., Ruckstuhl, A., Salibian-Barrera, M., Verbeke, T., Koller, M., Conceicao, E.L.T. and M. Anna di Palma (2022). robustbase: Basic Robust Statistics R package version 0.95-0. https://CRAN.R-project.org/package=robustbase

Maronna, R.A., Martin, D., V.J. Yohai and M. Salibian-Barrera (2019): Robust statistics: Theory and methods. Chichester: John Wiley and Sons, 2nd ed.

Richardson, A.M. and A.H. Welsh (1995). Robust restricted maximum likelihood in mixed linear model. Biometrics 51, 1429–1439. doi: 10.2307/2533273

Rousseeuw, P. J. and K. Van Driessen (2006). Computing LTS regression for large data sets. Data Mining and Knowledge Discovery 12, 29–45. doi: 10.1007/s10618-005-0024-4

Schoch, T. (2012). Robust Unit-Level Small Area Estimation: A Fast Algorithm for Large Datasets. Austrian Journal of Statistics 41, 243–265. http://www.stat.tugraz.at/AJS/ausg124/124Schoch.pdf

See Also

fitsaemodel.control()

Examples

# generate synthetic data
m <- makedata()

# Huber M-estimate with robustness tuning constant k = 2
m_fitted <- fitsaemodel("huberm", m, k = 2)
m_fitted

# summary of the fitted model
summary(m_fitted)

rsae documentation built on May 24, 2022, 5:06 p.m.