R/nobs.R

Defines functions nobs.cov_ML nobs.cov_Huber nobs.rq

# --------------------------------------
# Author: Andreas Alfons
#         Erasmus Universiteit Rotterdam
# --------------------------------------

## extract number of observations from median regression
#' @export
#' @import stats
nobs.rq <- function(object, ...) {
  residuals <- residuals(object)
  length(residuals)
}

## extract number of observations from Huber M-estimator of location and scatter
#' @export
#' @import stats
nobs.cov_Huber <- function(object, ...) {
  weights <- weights(object, type="relative")
  length(weights)
}

## extract number of observations from MLE of mean vector and covariance matrix
#' @export
#' @import stats
nobs.cov_ML <- function(object, ...) object$n
aalfons/robmed documentation built on July 4, 2023, 7:48 a.m.