hbrrewted: Function which computes the weights for the iteratively...

Description Usage Arguments Examples

Description

Function which computes the weights for the iteratively reweighted LS estimate of the HBR fit.

Usage

1
hbrrewted(x, y, percent = 0.95, ehat0 = ltsreg(x, y)$residuals)

Arguments

x
y
percent
ehat0

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, y, percent = 0.95, ehat0 = ltsreg(x, y)$residuals) 
{
    x = as.matrix(x)
    n = dim(x)[1]
    p = dim(x)[2]
    robdis2 <- robdist.hbrfit(x)
    cut = qchisq(percent, p)
    sigma = mad(ehat0)
    m = psi(cut/robdis2)
    a = ehat0/(sigma * m)
    c = (median(a) + 3 * mad(a))^2
    h = sqrt(c)/a
    hbrrewted = psi(abs(h))
    mat <- cbind(hbrrewted, ehat0, robdis2)
    return(mat)
  }

joemckean/rewtedhbr documentation built on May 31, 2019, 1:51 a.m.