Displaying 20 results from an estimated 48 matches for "reweight".
2009 Jul 01
1
Iteratively Reweighted Least Squares of nonlinear regression
Dear all,
When doing nonlinear regression, we normally use nls if e are iid normal.
i learned that if the form of the variance of e is not completely known,
we can use the IRWLS (Iteratively Reweighted Least Squares )
algorithm:
for example, var e*i =*g0+g1*x*1
1. Start with *w**i = *1
2. Use least squares to estimate b.
3. Use the residuals to estimate g, perhaps by regressing e^2 on *x*.
4. Recompute the weights and goto 2.
Continue until convergence
i was wondering whether there is a...
2005 Dec 22
1
Huber location estimate
...timate:
> set.seed(221205)
> y <- 7 + 3*rt(30,1)
> library(MASS)
> huber(y)$mu
[1] 5.9117
> coefficients(rlm(y~1))
(Intercept)
5.9204
I was surprised to get two different results. The function huber() works
directly with the definition whereas rlm() uses iteratively reweighted
least squares.
My surprise is because I vaguely remember
@ARTICLE{hw77,
author = {Holland, P. W. and Welsch, R. E.},
title = {Robust Regression using Iteratively Reweighted Least-Squares},
journal = {Communications in Statistics: Theory and Methods},
volume = {A6(9)},
number...
2008 Jul 23
3
maximum likelihood method to fit a model
Dear R users,
I use the glm() function to fit a generalized linear model with gamma distribution function and log link.
I have read in the help page that the default method used by R is "glm.fit" (iteratively reweighted least squares, IWLS).
Is it possible to use maximum likelihood method?
Thanks
Silvia Narduzzi
Dipartimento di Epidemiologia
ASL RM E
Via di S. Costanza, 53
00198 Roma
Tel +39 06 83060461
Mail narduzzi at asplazio.it
2005 Jan 27
2
Results of MCD estimators in MASS and rrcov
Hi!
I tested two different implementations of the robust MCD estimator:
cov.mcd from the MASS package and
covMcd from the rrcov package.
Tests were done on the hbk dataset included in the rrcov package.
Unfortunately I get quite differing results -- so the question is whether
this differences are justified or an error on my side or a bug?
Here is, what I did:
> require(MASS)
>
2013 Nov 06
3
Nonnormal Residuals and GAMs
...ver unbiased linear estimators.
What I am trying to determine is whether or not it is necessary to check
for normally-distributed errors in a GAM from mgcv. I know that the
unsmoothed terms, if any, will be fitted by ordinary least-squares but I
am unsure whether the default Penalized Iteratively Reweighted Least
Squares method used in the package is also based upon this assumption or
falls under any analogue to the Gauss-Markov Theorem.
Thank you in advance for any help.
Sincrely,
Collin Lynch.
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 *
2013 Apr 24
2
Trouble Computing Type III SS in a Cox Regression
...true, how to get it out of R
I use the word "cult" on purpose -- an entire generation of users who believe in the
efficacy of this incantation without having any idea what it actually does. In many
particular instances the SAS type III corresponds to a survey sampling question, i.e.,
reweight the data so that it is balanced wrt factor A and then test factor B in the new
sample. The three biggest problems with type III are that
1: the particular test has been hyped as "better" when in fact it sometimes is sensible
and sometimes not, 2: SAS implemented it as a computational a...
2004 Jul 03
2
DSTEIN error (PR#7047)
Full_Name: Stephen Weigand
Version: 1.9.0
OS: Mac OS X 10.3.4
Submission from: (NULL) (68.115.89.235)
When running an iteratively reweighted least squares program R crashes and the
following is
written to the console.app (when using R GUI) or to stdout (when using R from
the command
line):
Parameter 5 to routine DSTEIN was incorrect
Mac OS BLAS parameter error in DSTEIN, parameter #0, (unavailable), is 0
In case it helps, here's...
2001 Oct 26
2
glim and gls
Hello,
I would like to know if there is any package that allow us to fit
Generalized Linear Models via Maximum Likelihood and Linear Models using
Generalized Least Squarse in R as the functions glim and gls,
respectively, from S-Plus.
Also, anybody know if there is any package that fit Log-Linear Models
using Generalized Least Squares?
Any help will be very useful.
Thanks,
--
Frederico
2005 Aug 10
2
Exponential, Weibull and log-logistic distributions in glm()
Dear R-users!
I would like to fit exponential, Weibull and log-logistic via glm() like
functions. Does anyone know a way to do this? Bellow is a bit longer
description of my problem.
Hm, could family() be adjusted/improved/added to allow for these distributions?
SAS procedure GENMOD alows to specify deviance and variance functions to
help in such cases. I have not tried that option and I do not
2010 Oct 12
1
GLM Gamma Regression error message in R
...my specific data and research problem at hand, I
am fitting a gamma regression model to 13 000 lines of insurance claims
data, which will be regressed against categorical variables such as Age
Band, Gender, and Region.
Perhaps my problem arises because the data set is too large and the
iteratively reweighted least squares algorithm therefore cannot converge, in
which case I perhaps need another GLM type. Or maybe the categorical
explanatory variables can take on too many values (e.g. there are 15 Age
Bands, 5 Regions).
Any insights you could provide would be much appreciated.
Thank you ever so much...
2007 Dec 04
2
weighted Cox proportional hazards regression
I'm getting unexpected results from the coxph function when using
weights from counter-matching. For example, the following code
produces a parameter estimate of -1.59 where I expect 0.63:
d2 = structure(list(x = c(1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
1, 0, 0, 1, 0, 1, 0, 1, 0, 1), wt = c(5, 42, 40, 4, 43, 4, 42,
4, 44, 5, 38, 4, 39, 4, 4, 37, 40, 4, 44, 5, 45, 5, 44, 5), riskset =
2007 Nov 21
1
equivalent of Matlab robustfit?
...regression
B = ROBUSTFIT(X,Y) 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...
2015 Feb 18
3
Recycling memory with a small free list
> ... with assignments inside of loops like this:
>
> reweight = function(iter, w, Q) {
> for (i in 1:iter) {
> wT = w * Q
> }
> }
> ... before the RHS is executed, the LHS allocation would be added
> to a small fixed length list of available space which is checked
> before future allocations. If the same size is requested before...
2010 Oct 21
1
Limitations and scale of R, and performance issues if and when limit reached
...o have small or zero
> frequencies.
> In addition, adding a new variable to the model would at least double the
> number
> of cells, spreading/thinning out the data even more.
>
>>
>> Perhaps my problem arises because the data set is too large and the
>> iteratively reweighted least squares algorithm therefore cannot converge,
>> in
>> which case I perhaps need another GLM type. Or maybe the categorical
>> explanatory variables can take on too many values (e.g. there are 15 Age
>> Bands, 5 Regions).
>>
>
> If your response is continu...
2015 Feb 17
0
Recycling memory with a small free list
I'm trying to improve the performance of the update loop within a
logistic regression, and am struggling against the overhead of memory
allocation and garbage collection. The main issue I'd like to solve
is with assignments inside of loops like this:
reweight = function(iter, w, Q) {
for (i in 1:iter) {
wT = w * Q
}
}
If the matrix Q is large I can get a significant gain in performance
if I can reuse the same allocation for wT rather than making a new
allocation on each loop iteration.
While I can solve this problem in this case with an Rcpp f...
2007 Mar 20
1
How does glm(family='binomial') deal with perfect sucess?
Hi all,
Trying to understand the logistic regression performed by glm (i.e. when
family='binomial'), and I'm curious to know how it treats perfect
success. That is, lets say I have the following summary data
x=c(1,2,3,4,5,6)
y=c(0,.04,.26,.76,.94,1)
w=c(100,100,100,100,100,100)
where x is y is the probability of success at each value of x,
calculated across w observations.
2008 Jan 14
1
[Off Topic] searching for a quote
Dear community,
I'm trying to track down a quote, but can't recall the source or the
exact structure - not very helpful, I know - something along the lines
that:
80% of [applied] statistics is linear regression ...
?
Does this ring a bell for anyone?
Thanks,
Andrew
--
Andrew Robinson
Department of Mathematics and Statistics Tel: +61-3-8344-9763
University of
2006 Jan 25
1
About lmer output
Dear R users:
I am using lmer fo fit binomial data with a probit link function:
> fer_lmer_PQL<-lmer(fer ~ gae + ctipo + (1|perm) -1,
+ family = binomial(link="probit"),
+ method = 'PQL',
+ data = FERTILIDAD,
+ msVerbose= True)
The output look like this:
> fer_lmer_PQL
Generalized linear mixed model fit
2007 Jun 11
0
Weighted least squares
...sampling weights (selection probability weights)
I'll add:
* inverse-variance weights, where var(y for observation) = 1/weight
(as opposed to just being inversely proportional to the weight)
* weights used as part of an algorithm (e.g. for robust estimation,
or glm's using iteratively-reweighted least-squares).
For linear regression, the type of weights don't affect regression
coefficient calculation, but do affect inferences such as standard errors
for the regression coefficients, degrees of freedom for variance
estimates, etc.
lm() inferences assume the first type.
Other form...