search for: bisquare

Displaying 19 results from an estimated 19 matches for "bisquare".

2009 Aug 12
1
psi not functioning in nlrob?
Hi all, I'm trying to fit a nonlinear regression by "nlrob": model3=nlrob(y~a1*x^a2,data=transient,psi=psi.bisquare, start=list(a1=0.02,a2=0.7),maxit=1000) However an error message keeps popping up saying that the function psi.bisquare doesn't exist. I also tried psi.huber, which is supposed to be the default for nlrob: model3=nlrob(y~a1*x^a2,data=transient,psi=psi.huber, start=list(a1=0.02,a2=0.7),maxit=...
2008 Jan 19
1
How do we get two-tailed p-values for rlm?
How do we get 2-tailed p-values for the rlm summary? I'm using the following: > fit <- rlm(oatRT ~ oatoacData$erp, psi=psi.bisquare, maxit=100, na.action='na.omit') > fitsum <- summary(fit, cor=F) > print(fitsum) Call: rlm(formula = oatRT ~ oatoacData$erp, psi = psi.bisquare, maxit = 100, na.action = "na.omit") Residuals: Min 1Q Median 3Q Max -120.616 -50.637 -5.895...
2018 Apr 06
1
Fast tau-estimator line does not appear on the plot
...lm(Y ~ X) plot(X,Y) abline(reg1, col="black") install.packages("robustbase") library?(robustbase) reg=lmrob(Y ~ X) abline(reg, col="green") install.packages("MASS")? library(MASS) Huber=rlm(Y ~ X) abline(Huber,col="red") Tukey=rlm(Y ~ X,psi=psi.bisquare) abline(Tukey,col="purple") install.packages("quantreg") library(quantreg) L1=rq(Y ~ X,tau=0.5) abline(L1,col="blue") install.packages("RobPer") library(RobPer) FastTau(Y,X) fast=FastTau(Y,X) abline(unlist(fast), col="yellow") legend("toprig...
1999 Sep 17
1
Tukey's biweight
I want to estimate the center of a distribution with lots of outliers in one tail, and thought I would use a function such as S-plus's location.m() with psi.fun=bisquare (as per MASS 3 p. 131). However, R seems not have such a function, so my questions are: 1) Is there an R equivalent to location.m()? 2) Would huber() give me results that are similar (i.e., close enough)? Thanks. ______________________________________________________________________ Stuart Luppesc...
2004 Apr 27
0
lmRobMM vs rlm
...am very worried by this discrepancy what have I done wrong? I read in R:Robust Fitting of Linear Models: MM estimation is M-Estimation with Tukey's biweight initialized by a specific S-estimator and so I alter my S-Plus code to ct<-lmRobMM.robust.control(weight=c("Optimal","Bisquare")) fit<-lmRobMM(formula=V4~V1+V2+V3,data=data, robust.control=ct) and obtain for my residuals 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6.132346 1.061665 6.342018 8.212728 -0.7022119 -1.244742 -...
2011 Dec 19
2
nlrob problem
Dear all, I am not sure if this mail is for R-help or should be sent to R-devel instead, and therefore post to both. While using nlrob from package 'robustbase', I ran into the following problem: For psi-functions that can become zero (e.g. psi.bisquare), weights in the internal call to nls can become zero. Example: d <- data.frame(x=1:5,y=c(2,3,5,10,9)) d.nlrob <- nlrob(y ~ k*x,start=list(k=1),data=d,psi=psi.bisquare) I think the problem is as follows: After the call to nls, a weighted residual vector is calculated by dividing by...
2018 Apr 07
0
Fast tau-estimator line does not appear on the plot
...6,20,21,25,19,12,11,9,28,21,10,2,8) reg1 <- lm( Y ~ X ) plot( X, Y ) abline( reg1, col = "black" ) reg <- lmrob( Y ~ X ) abline( reg, col = "green" ) Huber <- rlm( Y ~ X ) abline( Huber, col="red" ) Tukey <- rlm( Y ~ X, psi = psi.bisquare ) abline( Tukey, col = "purple" ) L1 <- rq( Y ~ X, tau = 0.5 ) abline( L1, col = "blue" ) fast <- FastTau(model.matrix(~X),Y) fast # save result, then print... avoid computing twice # model matrix leads to first element of beta as constant and # seco...
2007 Nov 21
1
equivalent of Matlab robustfit?
...returns the vector B of regression coefficients, obtained by performing robust regression to estimate the linear model Y = Xb. X is an n-by-p matrix of predictor variables, and Y is an n-by-1 vector of observations. The algorithm uses iteratively reweighted least squares with the bisquare weighting function. By default, ROBUSTFIT adds a column of ones to X, corresponding to a constant term in the first element of B. Do not enter a column of ones directly into the X matrix. B = ROBUSTFIT(X,Y,'WFUN',TUNE) uses the weighting function 'WFUN' and tu...
2018 Mar 31
0
Fast tau-estimator line does ot appear on the plot
...;) > library?(robustbase) > reg=lmrob(Z ~ Y, data = Dataset) > abline(reg, col="green") > > install.packages("MASS") > library(MASS) > Huber=rlm(Z ~ Y, data = Dataset) > abline(Huber,col="red") > > Tukey=rlm(Z ~ Y, data = Dataset,psi=psi.bisquare) > abline(Tukey,col="purple") > > install.packages("quantreg") > library(quantreg) > L1=rq(Z ~ Y, data = Dataset,tau=0.5) > abline(L1,col="blue") > > install.packages("RobPer") > library(RobPer) > FastTau(Z,Y) > fast=Fas...
2018 Mar 31
2
Fast tau-estimator line does ot appear on the plot
...k") install.packages("robustbase") library?(robustbase) reg=lmrob(Z ~ Y, data = Dataset) abline(reg, col="green") install.packages("MASS")? library(MASS) Huber=rlm(Z ~ Y, data = Dataset) abline(Huber,col="red") Tukey=rlm(Z ~ Y, data = Dataset,psi=psi.bisquare) abline(Tukey,col="purple") ? install.packages("quantreg") library(quantreg) L1=rq(Z ~ Y, data = Dataset,tau=0.5) abline(L1,col="blue") ? install.packages("RobPer") library(RobPer) FastTau(Z,Y) fast=FastTau(Z,Y) abline(fast, col="yellow") #########...
2018 Apr 13
0
cvTools for 2 models not working
...,17,14,13,14,25,13,17,25,14,13,19,25,16,16,20,21,25,19,12,11,9,28,21,10,2,8) Z <- c(34,32,12,23,54,12,13,54,52,32,39,19,32,12,11,10,9,8,45,34,23,26,29,6,35,47,21,29,26,25) ? reg1 <- lm( Y ~ X+Z ) ? reg <- lmrob( Y ~ X + Z) ? Huber <- rlm( Y ~ X +Z) ? Tukey <- rlm( Y ~ X+Z, psi = psi.bisquare ) ? L1 <- rq( Y ~ X + Z, tau = 0.5 ) ? fast <- FastTau(model.matrix(~X+Z),Y) HBR<-hbrfit(Y ~ X +Z)? cvFit(lmrob,formula=Y ~ X + Z, cost=rtmspe, K=5, R=100) ? cvFit(lm,formula=Y ~ X + Z, cost=rtmspe, K=5, R=100) cvFit(rlm,formula=Y ~ X + Z, cost=rtmspe, K=5, R=100) cvFit(rlm,formula=Y ~...
2005 Mar 24
1
Robust multivariate regression with rlm
...x) Coefficients: [,1] [,2] (Intercept) 0.934727 3.918421 Mx1 1.003517 -0.004202 Mx2 -0.002624 0.998155 > model<-rlm(My~Mx) Error in lm.wfit(x, y, w, method = "qr") : incompatible dimensions > model<-rlm(My~Mx,psi=psi.bisquare) Error in lm.wfit(x, y, w, method = "qr") : incompatible dimensions Another example (this one seems to work): > Mx<-matrix(c(0,0,1,0,0,1),ncol=2,byrow=TRUE)+1 > My<-matrix(c(0,0,1,1,-1,1),ncol=2,byrow=TRUE)+1 > model<-rlm(My~Mx) > model Call: rlm(formula =...
2005 Aug 23
1
Robust M-Estimator Comparison
Hello, I'm learning about robust M-estimators right now and had settled on the "Huber Proposal 2" as implemented in MASS, but further reading made clear, that at least 2 further weighting functions (Hampel, Tukey bisquare) exist. In a post from B.D. Ripley going back to 1999 I found the following quote: >> 2) Would huber() give me results that are similar (i.e., close enough)? > > Not if you have lots of extreme outliers on just one side. Since this message seems to imply that the nature of the data...
2012 Oct 07
3
Robust regression for ordered data
I have two regressions to perform - one with a metric DV (-3 to 3), the other with an ordered DV (0,1,2,3). Neither normal distribution not homoscedasticity is given. I have a two questions: (1) Some sources say robust regression take care of both lack of normal distribution and heteroscedasticity, while others say only of normal distribution. What is true? (2) Are there ways of using robust
2006 Mar 30
0
Robust measures of goodness of fit?
...Chapter 11 of statman1.pdf. I think the s-plus method lmRobMM() returns this "robust R-squared", but I would like to stay within R. Implementing the abovementioned formulas in R was not straightforward because the definition and notation of the loss functions (psi,rho,Tukey's bisquare) differ between statman1.pdf and http://spider.stat.umn.edu/R/library/MASS/html/rlm.html I would be most grateful for any references or tips. [1] I'm picturing my data as possibly contaminated by some other phenomenon than the one I'm interested in. What I think I want is a robust est...
2018 Apr 25
0
Zero errors : Bug in my R code ?
...:regr.eval(newdata$crp,reg1$fitted.values) reg <- lmrob( crp ~ bmi+glucose,data=newdata) DMwR::regr.eval(newdata$crp,reg$fitted.values) Huber <- rlm( crp ~ bmi+glucose,data=newdata) DMwR::regr.eval(newdata$crp,Huber$fitted.values) Tukey <- rlm( crp ~ bmi+glucose, data=newdata, psi = psi.bisquare ) DMwR::regr.eval(newdata$crp,Tukey$fitted.values) L1 <- rq( crp ~ bmi+glucose, data=newdata, tau = 0.5 ) DMwR::regr.eval(newdata$crp,L1$fitted.values) fast <- FastTau(model.matrix(~newdata$bmi+newdata$glucose),newdata$crp) DMwR::regr.eval(newdata$crp,fast$fitted.values) HBR<-hbrfit(crp...
2012 Nov 22
1
help in M-estimator by R
...quot;proposal 2"), k2 = 1.345, method = c("M", "MM"), wt.method = c("inv.var", "case"), maxit = 20, acc = 1e-4, test.vec = "resid", lqs.control = NULL) 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) and all these ways works by default function as psi.huber and i want to add new psi ( psi.a=r/(1+(r/k)^2)) ,k=1.345 and get on new coefficients to the model, and, Is all the arguments are necessary ? " i want short code" again ... *how can i do this ... * than...
2002 Mar 19
3
plot with the axes at xlim and ylim
I'd like to make a plot with the axes drawn at the values of xlim and ylim. The default plot draws the axes slightly outside these values. I have been experimenting with the par(mgp) setting, but specifying par(mgp=c(2,0,-1)) gives me "invalid value specified for graphics parameter "mgp".". A more complicated mathod that almost seems to work is doing the plot with
2004 Oct 11
3
split and rlm
Hello, I'm trying to do a little rlm of some data that looks like this: UNIT COHORT perdo adjodds 1010 96 0.39890 1.06894 1010 97 0.48113 1.57500 1010 98 0.36328 1.21498 1010 99 0.44391 1.38608 It works fine like this: rlm(perdo ~ COHORT, psi=psisquare) But the problem is that I have about 100 UNITs, and I want to do a