[R] R-Help
Bello A rasheed
arasheedbello at yahoo.com
Mon Dec 14 09:27:20 CET 2015
Dear R users
Kindly help me on how run this code because there is error when ever i run it.
It give me an error at Error: lent >= 1 is not TRUE
Error: object 'hubPsi' not found
Error in cbind(b = b, A = A, B = B, V = A/B^2, e = B^2/A, gamma. = b/B, : dims [product 3] do not match the length of object [21] Thank you in advance********************************************************
R-CODE
Hf0 <- function(x, c=1.35) pmax2(-c,pmin2(x,c))
Hf <- new("functionX",Hf0)
stopifnot(validObject(Hf)) # ok !
### psiFunc() examples## classical {trivial, notinteresting}:
F1 <- function(x) rep.int(1,length(x))
cPsi <- psiFunc(rho = function(x)x^2 / 2, psi = function(x) x,
wgt = F1, Dpsi = F1,
Erho = function(x) rep.int(1/2,length(x)),
Epsi2 = F1, EDpsi = F1)
### MASS -- ?rlm --- has
##
##- psi.huber (u, k = 1.345, deriv =0)
##- psi.hampel (u, a = 2, b = 4, c =8, deriv = 0)
##- psi.bisquare(u, c = 4.685, deriv = 0)
## where deriv = 0 : psi(x)/xi.e. 'wgt'
## MM has more in psi-funs.R (seeabove)
## Reproduce Table 1, p.138 of Hampel,Rousseeuw, Ronchetti, Stahel (1986):
b <- c(seq(0, 3, by = 0.1), 4, 5,Inf)
A <- hubPsi at Epsi2(b)
B <- hubPsi at EDpsi(b)
options(width = 100, digits = 7)
cbind(b = b, A = A, B = B, V = A/B^2, e= B^2/A,
gamma. = b/B, k. = 1 + b^2/A, lambda. = 1/B)
(hubPsi2 <- chgDefaults(hubPsi, k =2)) # works too!
Bello Abdulkadir RasheedPh.D candidate ( mathematics/statistics)
Department of mathematical Science/ faculty of Science
University Technology Malaysia
81310 UTM, Johor Bahru, Johor, Malaysia
IC. NO. 201204M10026
Matric No. PS113124
HP. No. 0060149144837E-mail: arasheedbello at yahoo.com
supervisor- Assoc. Prof. Robiah Binti Adnan
[[alternative HTML version deleted]]
More information about the R-help
mailing list