Description Usage Arguments Details Value Author(s) See Also Examples

Density, distribution function, quantile function and random generation for Huber's least favourable distribution, see Huber and Ronchetti (2009).

1 2 3 4 5 |

`x, q` |
numeric vector, vector of quantiles. |

`p` |
vector of probabilities. |

`n` |
number of random values to be generated.
If |

`k` |
numeric. Borderline value of central Gaussian part of the
distribution.
This is known as the tuning constant, and should be positive.
For example, |

`mu` |
numeric. distribution mean. |

`sigma` |
numeric. Distribution scale ( |

`log` |
Logical.
If |

`lower.tail, log.p` |
Same meaning as in |

Details are given in `huber2`

, the
VGAM family function for estimating the
parameters `mu`

and `sigma`

.

`dhuber`

gives out a vector of density values.

`edhuber`

gives out a list with components `val`

(density
values) and `eps`

(contamination proportion).

`rhuber`

gives out a vector of random numbers generated by
Huber's least favourable distribution.

`phuber`

gives the distribution function,
`qhuber`

gives the quantile function.

Christian Hennig wrote `[d,ed,r]huber()`

(from smoothmest) and
slight modifications were made by T. W. Yee to
replace looping by vectorization and addition of the `log`

argument.
Arash Ardalan wrote `[pq]huber()`

, and
two arguments for these were implemented by Kai Huang.
This helpfile was adapted from smoothmest.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
set.seed(123456)
edhuber(1:5, k = 1.5)
rhuber(5)
## Not run: mu <- 3; xx <- seq(-2, 7, len = 100) # Plot CDF and PDF
plot(xx, dhuber(xx, mu = mu), type = "l", col = "blue", las = 1, ylab = "",
main = "blue is density, orange is cumulative distribution function",
sub = "Purple lines are the 10,20,...,90 percentiles",
ylim = 0:1)
abline(h = 0, col = "blue", lty = 2)
lines(xx, phuber(xx, mu = mu), type = "l", col = "orange")
probs <- seq(0.1, 0.9, by = 0.1)
Q <- qhuber(probs, mu = mu)
lines(Q, dhuber(Q, mu = mu), col = "purple", lty = 3, type = "h")
lines(Q, phuber(Q, mu = mu), col = "purple", lty = 3, type = "h")
abline(h = probs, col = "purple", lty = 3)
phuber(Q, mu = mu) - probs # Should be all 0s
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.