gday R gurus, I have a multivariate regression for which I want to constrain the coefficients to be > 0. Is this possible? I've check the doco and searched CRAN but can't find anything. thanks, John Strumila -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Strumila, John" wrote:> > gday R gurus, > > I have a multivariate regression for which I want to constrain the > coefficients to be > 0. Is this possible? > > I've check the doco and searched CRAN but can't find anything. > > thanks, > John StrumilaI've been doing something like that (regression coefficients constrained to be > 0 and also forced to sum to 1) using the quadratic programming program solve.QP in package quadprog. Adam Gehr -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 5 Jan 2001, Strumila, John wrote:> gday R gurus, > > I have a multivariate regression for which I want to constrain the > coefficients to be > 0. Is this possible?Is that multiple linear regression? (one y, lots of x's?) Multivariate regression might be thought to have many y's and only model part of the relationship amongst them by many x's. Fitting by least-squares, it is a quadratic programming problem. So either use the quadprog package on CRAN, or use a general minimizer with constraints: set forward optim(). Here's an example from the VR script ch08.R: library(MASS) data(whiteside) attach(whiteside) Gas <- Gas[Insul=="Before"] Temp <- -Temp[Insul=="Before"] #nnls.fit(cbind(1, -1, Temp), Gas) : this is an S-PLUS function # can use box-constrained optimizer fn <- function(par) sum((Gas - par[1] - par[2]*Temp)^2) optim(rep(0,2), fn, lower=0, method="L-BFGS-B")$par rm(Gas, Temp) detach() You can do non-linear regression and non-LS fitting the same way. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
A Bayesian approach to regression with inequality constraints on the coefficients is to estimate the regression without constraints, sample from the distribution of the coefficients, discard draws that violate the inequality constraints, and finally compute summary statistics from the remaining subsample. Andrew Gelman et al. explain how to do that in Bayesian Data Analysis. I believe they implemented their procedures in S-Plus. If any one has written similar programs in R, please let us know. ----- Original Message ----- From: Strumila, John <John.Strumila at team.telstra.com> To: <R-help at stat.math.ethz.ch> Sent: Thursday, January 04, 2001 4:56 PM Subject: [R] regression constraints?> gday R gurus, > > I have a multivariate regression for which I want to constrain the > coefficients to be > 0. Is this possible? > > I've check the doco and searched CRAN but can't find anything. > > thanks, > John Strumila > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> r-help mailing list -- Readhttp://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html> Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
A Bayesian approach to regression with inequality constraints on the coefficients is to estimate the regression without constraints, sample from the distribution of the coefficients, discard draws that violate the inequality constraints, and finally compute summary statistics from the remaining subsample. Andrew Gelman et al. explain how to do that in Bayesian Data Analysis. I believe they implemented their procedures in S-Plus. If any one has written similar programs in R, please let us know. ----- Original Message ----- From: Strumila, John <John.Strumila at team.telstra.com> To: <R-help at stat.math.ethz.ch> Sent: Thursday, January 04, 2001 4:56 PM Subject: [R] regression constraints?> gday R gurus, > > I have a multivariate regression for which I want to constrain the > coefficients to be > 0. Is this possible? > > I've check the doco and searched CRAN but can't find anything. > > thanks, > John Strumila > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> r-help mailing list -- Readhttp://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html> Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I hate to chew up list bandwidth but I just gotta say thanks to Brian Ripley, John Burkett and Adam Gehr. As usual, excellent advice. John Strumila -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Richard A. Bilonick
2001-Mar-27 15:52 UTC
[R] Connecting R Running on Linux to an Oracale Database Running on Another Server
I need to access an Oracle database running on another server from my Linux box running R. I've downloaded RODBC but I have a sinking feeling I need more things to do this. I would appreciate any information on how I could do this. I would also consider other ways of accessing the Oracle database from the Linux box. I know I can buy and install Oracle8i. I also think I can just install an Oracl client to access the data on the other machine. Thanks. Rick Bilonick -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._