Displaying 20 results from an estimated 80000 matches similar to: "Help with recursive least squares"
2007 Nov 28
2
alternatives to traditional least squares method in linear regression ?
Dear list,
I have encountered a special case for searching a linear regression
where I'm not satisfied with the results obtained using the traditional
least squares method (sometimes called OLS) for estimating/optimizing
the residues to the regression line (see code below). Basically, a
group of my x-y data are a bit off the diagonal line (in my case the
diagonal represents the ideal or
2010 Jan 28
3
weighted least squares vs linear regression
I need to find out the difference between the way R calculates weighted
regression and standard regression.
I want to plot a 95% confidence interval around an estimte i got from least
squares regression.
I cant find he documentation for this
ive looked in
?stats
?lm
?predict.lm
?weights
?residuals.lm
Can anyone shed light?
thanks
Chris.
--
View this message in context:
2012 Feb 04
1
least squares solution to linear system
Dear all
I am having a linear system of the form
A*X=B and I want to find the X by using least squares.
For example my A is of dimension [205,3] and my B is of dimension[205,1]
I am looking for the X matrix which is of the size [3,1]. In the matlab I was doing that by the function
X = LSCOV(A,B) returns the ordinary least squares solution to the
linear system of equations A*X = B, i.e., X
2012 Nov 21
2
Weighted least squares
Hi everyone,
I admit I am a bit of an R novice, and I was hoping someone could help me
with this error message:
Warning message:
In lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
extra arguments weigths are just disregarded.
My equation is:
lm( Y ~ X1 + X2 + X3, weigths = seq(0.1, 1, by = 0.1))
--
View this message in context:
2007 Jun 11
0
Weighted least squares
As John noted, there are different kinds of weights, and
different terminology:
* inverse-variance weights (accuracy weights)
* case weights (frequencies, counts)
* 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
2007 May 28
1
monthly least squares estimation
Hi R-programmers !
I would like to perform a linear model regression month by month using the
'lm' function and i don't know how to do it.
The data is organised as below:
Month ExcessReturn Return STO
8 0.047595875 0.05274292 0.854352503
8 0.016134874 0.049226941 4.399372005
8 -0.000443869 0.004357305 -1.04980297
9 0.002206554 -0.089068828 0.544809429
9 0.021296551
2004 Sep 15
1
adding observations to lm for fast recursive residuals?
dear R community: i have been looking but failed to find the
following: is there a function in R that updates a plain OLS lm()
model with one additional observation, so that I can write a function
that computes recursive residuals *quickly*?
PS: (I looked at package strucchange, but if I am not mistaken, the
recresid function there takes longer than iterating over the models
fresh from
2003 Sep 26
1
least squares regression using (inequality) restrictions
Dear R Users,
I would like to make a lesast squares regression similar to that what is
done by the command "lm". But additionally, I would like to impose some
restrictions:
1) The sum of all regression coefficients should be equal to 1.
2) Each coefficient should assume a value between 0 and 1. (inequality
restrictions)
Which command is the best to use in order to solve this problem
2008 Mar 10
1
Mimicking SPSS weighted least squares
Howdy,
In SPSS, there are 2 ways to weight a least squares regression:
1. You can do it from the regression menu.
2. You can set a global weight switch from the data menu.
These two options have no, in my experience, been equivalent.
Now, when I run lm in R with the weights= switch set accordingly, I
get the same set of results you would see with option #1 in SPSS.
Does anybody know how to
2009 Sep 19
1
plotting least-squares residuals against x-axis
Hi,
I want to plot the residuals of a least-squares regression.
plot(lm(y~x), which=1)
does this, but it plots the y-axis of my data on the x-axis of the
residuals plot. That is, it plots the residual for each y-value in the
data. Can I instead use the x-axis of my data as the x-axis of the
residuals plot, showing the residual for a given x?
Thanks!
Jason Priem
University of North
2003 Nov 01
1
Partial least squares.
Dear R-helpers,
I am looking, quite unsuccesfully, for a number of functions/packages.
Firstly, I am interested in a package for partial least squares. I have
found that there seemed to exist a package called pls, but which seems
not to run any more with modern versions of R. I have not been able to
find certain "chemometrics package" I found some people discussing about
in this
2009 May 07
2
Linear least squares fit with errors in both x and y values.
HI,
I'd like to perform a weighted linear least squares fit with R on data
with varying errors on both vectors. I can do this with one axis using
lm, but have no idea where to go from here. I've tried googling, but no
idea. Any suggestions?
Thanks,
James
2007 May 08
5
Weighted least squares
Dear all,
I'm struggling with weighted least squares, where something that I had
assumed to be true appears not to be the case. Take the following
data set as an example:
df <- data.frame(x = runif(100, 0, 100))
df$y <- df$x + 1 + rnorm(100, sd=15)
I had expected that:
summary(lm(y ~ x, data=df, weights=rep(2, 100)))
summary(lm(y ~ x, data=rbind(df,df)))
would be equivalent, but
2004 Oct 08
0
R interface for MINPACK least squares optimization library
Hello guys.
I've built and uploaded to CRAN an R interface to MINPACK Fortran library,
which solves non-linear least squares problem by modification of the
Levenberg-Marquardt algorithm. The package includes one R function, which
passes all the necessary control parameters to the appropriate Fortran
functions.
The package location is
2004 Oct 08
0
R interface for MINPACK least squares optimization library
Hello guys.
I've built and uploaded to CRAN an R interface to MINPACK Fortran library,
which solves non-linear least squares problem by modification of the
Levenberg-Marquardt algorithm. The package includes one R function, which
passes all the necessary control parameters to the appropriate Fortran
functions.
The package location is
2008 Jul 23
1
Questions on weighted least squares
Hi all,
I met with a problem about the weighted least square regression.
1. I simulated a Normal vector (sim1) with mean 425906 and standard deviation 40000.
2. I simulated a second Normal vector with conditional mean b1*sim1, where b1 is just a number I specified, and variance proportional to sim1. Precisely, the standard deviation is sqrt(sim1)*50.
3. Then I run a WLS regression without the
2009 Jan 22
2
Standard errors of least squares adjusted means
Hello,
I have the following model:
lm.7 <- lm(Y ~ F + C1 + C2 , data = EM4)
F is a 4-level factor, the rest are covariates centered at their mean (Y
is a two-column matrix).
I have tried to find functions to give the model-adjusted means
(adjusted at the covariates'means) and their standard deviations for each.
(That is, what I believe is called in SAS "least square or LS-means,
2009 Sep 20
3
plotting least-squares regression against x-axis
Hi,
I want to plot the residuals of a least-squares regression.
plot(lm(y~x), which=1)
does this, but it plots the y-axis of my data on the x-axis of the
residuals plot. That is, it plots the residual for each y-value in the
data. Can I instead use the x-axis of my data as the x-axis of the
residuals plot, showing the residual for a given x?
Thanks!
Jason Priem
University of North
2012 Jan 04
0
Non Negative Least Squares Regression with nnls
Hello R experts,
I have two questions related to the nnls library (http://www.inside-r.org/packages/cran/nnls), and more broadly to linear regression with positive coefficients. Sample code is below the Qs.
Q1: Regular regression (with lm) gives me the significance of each variable. How do I get variable significance with nnls? If there's no ready function, any easy way to manually derive
2007 Feb 28
3
Packages in R for least median squares regression and computing outliers (thompson tau technique etc.)
Hi
I am looking for suitable packages in R that do
regression analyses using least median squares method
(or better). Additionally, I am also looking for
packages that implement algorithms/methods for
detecting outliers that can be discarded before doing
the regression analyses.
Although some websites refer to "lms" method under
package "lps" in R, I am unable to find such a