[RsR] Huber rho function evaluation
Eva Cantoni
Ev@@C@nton| @end|ng |rom un|ge@ch
Thu Jun 14 14:56:14 CEST 2018
Dear all,
I would like to use the function Mpsi() to compute Huber's rho function
(deriv=-1), but I consistently get "Inf" values (and even NaN). Am I
missing something?
-----
> Mpsi(seq(-5,5,by=0.1),psi="huber",cc=1.35,deriv=-1)
[1] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf
[38] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf NaN Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf
[75] Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
----
Note that the Huber psi function evaluation (deriv=0) works well
> Mpsi(seq(-5,5,by=0.1),psi="huber",cc=1.35,deriv=0)
[1] -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35
-1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35
-1.35
[25] -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35 -1.35
-1.35 -1.35 -1.30 -1.20 -1.10 -1.00 -0.90 -0.80 -0.70 -0.60 -0.50 -0.40
-0.30
[49] -0.20 -0.10 0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80
0.90 1.00 1.10 1.20 1.30 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35
[73] 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35
1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35 1.35
[97] 1.35 1.35 1.35 1.35 1.35
and also the rho evaluation for other choices of functions (e.g. Tukey's
biweight)
> Mpsi(seq(-5,5,by=0.1),psi="biweight",cc=1.35,deriv=-1)
[1] 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000
[13] 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000
[25] 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000
[37] 0.303750000 0.303633276 0.300941930 0.292219930 0.275829615
0.251666667 0.220780758 0.185032340 0.146785551 0.108637255 0.073182210
0.042814358
[49] 0.019564254 0.004972615 0.000000000 0.004972615 0.019564254
0.042814358 0.073182210 0.108637255 0.146785551 0.185032340 0.220780758
0.251666667
[61] 0.275829615 0.292219930 0.300941930 0.303633276 0.303750000
0.303750000 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000
[73] 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000
[85] 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
0.303750000
[97] 0.303750000 0.303750000 0.303750000 0.303750000 0.303750000
Thank you for your help,
Eva
--
Prof. Eva Cantoni
Research Center for Statistics and
Geneva School of Economics and Management
University of Geneva, Bd du Pont d'Arve 40, CH-1211 Genève 4
gsem.unige.ch/rcs/cantoni
More information about the R-SIG-Robust
mailing list