Re: [R] Linear Regression with Constraints

2009-05-27 Thread Emmanuel Charpentier
Le mercredi 27 mai 2009 à 17:28 +1000, bill.venab...@csiro.au a écrit : > You can accommodate the constraints by, e.g., putting > > c2 = pnorm(theta2) > c3 = pnorm(theta3) Nice. I'd have tried invlogit(), but I'm seriously biased... > x1 has a known coefficient (unity) so it becomes an offset. >

Re: [R] Linear Regression with Constraints

2009-05-27 Thread Bill.Venables
-project.org] On Behalf Of Emmanuel Charpentier [charp...@bacbuc.dyndns.org] Sent: 27 May 2009 17:05 To: r-h...@stat.math.ethz.ch Subject: Re: [R] Linear Regression with Constraints Le mardi 26 mai 2009 à 14:11 -0400, Stu @ AGS a écrit : > Hi! > I am a bit new to R. > I am looking for the right

Re: [R] Linear Regression with Constraints

2009-05-27 Thread Emmanuel Charpentier
Le mardi 26 mai 2009 à 14:11 -0400, Stu @ AGS a écrit : > Hi! > I am a bit new to R. > I am looking for the right function to use for a multiple regression problem > of the form: > > y = c1 + x1 + (c2 * x2) - (c3 * x3) > > Where c1, c2, and c3 are the desired regression coefficients that are > su

Re: [R] Linear Regression with Constraints

2009-05-26 Thread Ravi Varadhan
Here is a demonstration of how to solve your problem : n <- 30 # You might need more than 6 data points to get good estimates for 3 parameters x1 <- rnorm(n) x2 <- runif(n) x3 <- rbinom(n, size=1, prob=0.4) A <- cbind(x1, x2, x3) # 30 x 3 matrix of independent variables b <- c(-1, 0.5, 0.2)

Re: [R] Linear regression with constraints on the parameters.

2007-10-08 Thread Moshe Olshansky
Hi Gopi, Simple linear regression minimizes sum of squares of the residuals. So in your case you can use Quadratic Programming (see quadprog package) to introduce linear constraints. Regards, Moshe. --- Gopi Goswami <[EMAIL PROTECTED]> wrote: > Hi there, > > > Is there an existing package in