Displaying 20 results from an estimated 39 matches for "wfit".
Did you mean:
wait
2008 Aug 07
1
Fitted values with small weights in lm.wfit (PR#11979)
...2.7.1
OS: Ubuntu 8.04 / Windows XP
Submission from: (NULL) (76.119.235.225)
When running lm(modeleq, weights=wt, data=dataset) with small weights (<1e-10),
I have encountered an odd phenomenon with fitted values. Due to numerical
precision issues, the fitted values and residuals returned by lm.wfit (from its
.Fortran call to dqrls) can differ greatly from those returned by running
predict on the resulting lm object. This is completely attributable to the
numerical precision passed to the given function, but I wonder if a warning
message for weights below as certain threshold may be in order.
2017 Oct 24
0
Issue of reproducibility with gam and lm.wfit in different versions of R
...gam call (changed to a NULL object)
* Comparing results from environments 4 and 5 shows that reverting to an older version of the gam package in R 3.3.2 still produced altered AIC values and the NULL output from step.gam call
Further investigations into these differences seem to show that the lm.wfit call in the gam.fit function (called from within gam and step.gam) may result in different values in R 3.3.0 and 3.3.2.
So my questions are 2-fold:
1- Would you have any information about why lm.wfit would produce different outcomes in R 3.3.0 and 3.3.2? The source code does not appear significa...
1999 Mar 09
0
Bug in lm.wfit with zero weights in 0.63.3 (PR#136)
R 0.63.3 (any platform)
library(lqs)
example(lqs)
gives
Warning in (y - z$residuals) + offset : longer object length
is not a multiple of shorter object length
repeatedly. The problem is in lm.wfit, which removes cases with
zero weights, but does not adjust the offset. The fix is
z$fitted.values <- (y - z$residuals)
z$weights <- w
if (zero.weights) {
coef[is.na(coef)] <- 0
f0 <- x0 %*% coef
if (ny > 1) {
save.r[ok, ] <- z$residuals
save.r[nok, ] &l...
2005 Mar 24
1
Robust multivariate regression with rlm
Dear Group,
I am having trouble with using rlm on multivariate data sets. When I
call rlm I get
Error in lm.wfit(x, y, w, method = "qr") :
incompatible dimensions
lm on the same data sets seem to work well (see code example). Am I
doing something wrong?
I have already browsed through the forums and google but could not find
any related discussions.
I use Windows XP and R Version 2.0.1 (...
2007 Dec 18
2
"gam()" in "gam" package
R-users
E-mail: r-help@r-project.org
I have a quenstion on "gam()" in "gam" package.
The help of gam() says:
'gam' uses the _backfitting
algorithm_ to combine different smoothing or fitting methods.
On the other hand, lm.wfit(), which is a routine of gam.fit() contains:
z <- .Fortran("dqrls", qr = x * wts, n = n, p = p, y = y *
wts, ny = ny, tol = as.double(tol), coefficients = mat.or.vec(p,
ny), residuals = y, effects = mat.or.vec(n, ny), rank = integer(1),
pivot = 1:p, qra...
2004 Oct 28
2
Weighted regresion using lm
Hi:
Could anyone help me to clarify this: are the weights normalized inside lm
function (package:stats) before applied to the error term? For example:
>lm (cost ~ material, weights=quatity, data=receipt)
will lm normalize quatity such that sum(quatity) = 1? I traced to lm.wfit and
then the weights get transferred into a precompiled FORTRAN module so I can't
figure out. Thanks!
> version
_
platform sparc-sun-solaris2.9
arch sparc
os solaris2.9
system sparc, solaris2.9
status...
2002 Jun 26
3
Bug or failing understanding?
...> test(7)
[1] 49
> test()
Error in test() : recursive default argument reference
here is a code fragment from lm() using the same syntax:
else {
x <- model.matrix(mt, mf, contrasts)
z <- if (is.null(w))
lm.fit(x, y, offset = offset, ...)
else lm.wfit(x, y, w, offset = offset, ...)
What is wrong?
Kjetil Halvorsen
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the...
2007 Oct 12
3
no visible binding
..."model.frame")
return(m)
Terms <- attr(m, "terms")
weights <- model.extract(m, weights)
Y <- model.extract(m, response)
X <- as.matrix.csr(model.matrix(Terms, m, contrasts))
fit <- {
if (length(weights))
slm.wfit(X, Y, weights, method, ...)
else slm.fit(X, Y, method, ...)
}
fit$terms <- Terms
fit$call <- call
attr(fit, "na.message") <- attr(m, "na.message")
class(fit) <- c(if (is.matrix(Y)) "mslm", "slm")
fit
}
ur...
2003 Nov 29
3
performance gap between R 1.7.1 and 1.8.0
...there in 1.8.0 already). Sorted by "self" part of the
output, the top 10 lines are:
R 1.7.1
% self % total
self seconds total seconds name
10.75 100.36 10.75 100.36 ".Fortran"
8.71 81.32 34.27 319.88 "lm.wfit"
5.43 50.66 81.19 757.88 "FLXfit"
4.30 40.16 4.30 40.16 "^"
4.26 39.80 4.26 39.80 "=="
4.15 38.74 4.99 46.62 "names"
3.90 36.38 20.57 191.98 "initialize"...
2010 May 26
2
Survival analysis extrapolation
Dear all,
I'm trying to fit a curve to some 1 year failure-time data, so that I can
extrapolate and predict failure rates up to 3 years. The data is in the
general form:
Treatment Time Status
Treatment A 28 0
Treatment B 28 0
Treatment B 28 0
Treatment A 28
2012 Nov 07
2
Correct use of Depends, Imports and ::
Dear R developers,
Taking advantage of the yesterday discussion about the use of
Depends/Import/Suggests/Enhances, I would like to add a related question.
Let's assume, in the DESCRIPTION file of my package foo0, I have:
Depends: foo1
Imports: foo2
while in the NAMESPACE file of my package I have
importFrom("foo2", f2)
and within my package I use the following two external
2007 Jan 30
1
SparseM and Stepwise Problem
I'm trying to use stepAIC on sparse matrices, and I need some help.
The documentation for slm.fit suggests:
slm.fit and slm.wfit call slm.fit.csr to do Cholesky decomposition and then
backsolve to obtain the least squares estimated coefficients. These functions can be
called directly if the user is willing to specify the design matrix in matrix.csr form.
This is often advantageous in large problems to reduce memory requir...
2007 Dec 18
1
R-users
R-users
E-mail: r-help@r-project.org
I have a quenstion on "gam()" in "gam" package.
The help of gam() says:
'gam' uses the _backfitting
algorithm_ to combine different smoothing or fitting methods.
On the other hand, lm.wfit(), which is a routine of gam.fit() contains:
z <- .Fortran("dqrls", qr = x * wts, n = n, p = p, y = y *
wts, ny = ny, tol = as.double(tol), coefficients = mat.or.vec(p,
ny), residuals = y, effects = mat.or.vec(n, ny), rank = integer(1),
pivot = 1:p, qra...
2010 Jan 12
1
Problems with betareg()
Hi,
In using the betareg package, I encounter the following error message:
Error in lm.wfit(x, linkfun(y), weights, offset = offset) :
NA/NaN/Inf in foreign function call (arg 4)
Any help will be most appreciated. Thanks in advance.
Alex
2015 Jan 09
1
Cost of garbage collection seems excessive
...ction(n) {
int <- -5
x <- rnorm(n, 50, 7)
e <- rnorm(n, 0, 1)
y <- int + (1.2 * x) + e
return(data.frame(y, x))
}
gc.time()
data <- createData(500000)
data.y <- as.matrix(data[1])
data.x <- model.matrix(y ~ ., data)
for (i in 1:100) speedglm.wfit(X=data.x, y=data.y, family=gaussian())
gc.time()
nate at haswell:~$ time Rscript gc.R
Loading required package: Matrix
Loading required package: methods
[1] 0 0 0 0 0
[1] 10.410 0.024 10.441 0.000 0.000
real 0m17.167s
user 0m16.996s
sys 0m0.176s
The total execution time is 17 seconds, and...
2013 Jan 29
3
how to suppress the intercept in an lm()-like formula method?
...!is.numeric(w))
stop("'weights' must be a numeric vector")
x <- model.matrix(mt, mf, contrasts)
# fixup to remove intercept???
z <- if (is.null(w))
cancor.default(x, y, ...)
else stop("weights are not yet implemented") # lm.wfit(x, y, w, ...)
z$call <- cl
z$terms <- mt
z
}
TESTME <- FALSE
if (TESTME) {
# need to get latest version, 0.6-1 from R-Forge
install.packages("candisc", repo="http://R-Forge.R-project.org")
library(candisc)
data(Rohwer)
# this bombs: needs interc...
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.
2025 Jan 07
2
Extracting specific arguments from "..."
...)) {
z$fitted.values <- offset
z$residuals <- y - offset
}
}
else {
x <- model.matrix(mt, mf, contrasts)
z <- if (is.null(w))
lm.fit(x, y, offset = offset, singular.ok = singular.ok,
...)
else lm.wfit(x, y, w, offset = offset, singular.ok = singular.ok,
...)
}
class(z) <- c(if (mlm) "mlm", "lm")
z$na.action <- attr(mf, "na.action")
z$offset <- offset
z$contrasts <- attr(x, "contrasts")
z$xlevels <- .getXle...
2025 Jan 07
1
Extracting specific arguments from "..."
...z$residuals <- y - offset
> }
> }
> else {
> x <- model.matrix(mt, mf, contrasts)
> z <- if (is.null(w))
> lm.fit(x, y, offset = offset, singular.ok = singular.ok,
> ...)
> else lm.wfit(x, y, w, offset = offset, singular.ok = singular.ok,
> ...)
> }
> class(z) <- c(if (mlm) "mlm", "lm")
> z$na.action <- attr(mf, "na.action")
> z$offset <- offset
> z$contrasts <- attr(x, "contrast...
1999 Jun 23
2
coercing factors to matrix() --> num/char ? --
Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> wrote:
> Martin Maechler <maechler at stat.math.ethz.ch> writes:
[ snip... ]
> > >From this logic, coercing to a matrix should coerce to character rather
> > than integer/numeric codes.
>
> Hm. I'm not sure there really is much logic in this... Factors are
> sometimes character-like, sometimes