File: weight.funs.Rd

package info (click to toggle)
r-cran-robust 0.7-5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,548 kB
  • sloc: fortran: 11,898; ansic: 741; sh: 13; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 1,813 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
\name{weight.funs}
\alias{psi.weight}
\alias{rho.weight}
\alias{psp.weight}
\alias{chi.weight}

\title{Weight Functions Psi, Rho, Chi}

\description{
  %% FIXME !
  These functions compute the weights used by lmRob and its associated methods.
}

\usage{
psi.weight(x, ips = 1, xk = 1.06)
rho.weight(x, ips = 1, xk = 1.06)
psp.weight(x, ips = 1, xk = 1.06)
chi.weight(x, ips = 1, xk = 1.06)
}

\arguments{
  \item{x}{a numeric vector.}

  \item{ips}{integer determining the weight function:
    \describe{
      \item{\code{ips = 1}}{"optimal"},
      \item{\code{ips = 2}}{rescaled bisquare},
      \item{\code{ips = 3}}{Huber},
      \item{\code{ips = 4}}{smoothed Huber},
      which is currently only available for \code{psi.*()} and its
      derivative \code{psp.*()}.
  }}
  \item{xk}{a numeric value specifying the tuning constant.}
}

\details{
  See the section \dQuote{Theoretical Details}, p. 58-59, in chapter 2 of
  \file{Robust.pdf}.
  %% Huber isn't there; and notably   "smoothed Huber" ain't
}

\value{
  a numeric vector, say \code{r} of the same length as \code{x},
  containing the function values \eqn{r_i = f(x_i)}{r[i] = f(x[i])}.
}

\examples{
x <- seq(-4,4, length=401)
f.x <- cbind(psi = psi.weight(x), psp = psp.weight(x),
             chi = chi.weight(x), rho = rho.weight(x))
es <- expression(psi(x), {psi*minute}(x), chi(x), rho(x))
leg <- as.expression(lapply(seq_along(es), function(i)
          substitute(C == E, list(C=colnames(f.x)[i], E=es[[i]]))))
matplot(x, f.x, type = "l", lwd = 1.5,
        main = "psi.weight(.) etc -- 'optimal'")
abline(h = 0, v = 0, lwd = 2, col = "#D3D3D380") # opaque gray
legend("bottom", leg, inset = .01,
       lty = 1:4, col = 1:4, lwd = 1.5, bg = "#FFFFFFC0")
}
\keyword{robust}