[R] Constrained regressions (suggestions welcome)
Bos, Roger
roger.bos at rothschild.com
Mon Sep 19 20:49:03 CEST 2011
All,
Could anyone recommend a package that allows the user to constrain the
coefficients from a multiple regression equation?
I tried using the gl1ce function in lasso2, but couldn't get it to
work. I created a contrived example to illustrate my starting point.
data(cars)
fmla <- formula(dist ~ speed)
gl1c.E <- gl1ce(fmla, data = cars)
gl1c.E
gl1c.E <- gl1ce(fmla, data = cars, link=identity())
gl1c.E
I started with the example, but I think my data is more Gaussian than
binomial. This returns the following errors.
> data(cars)
> fmla <- formula(dist ~ speed)
> gl1c.E <- gl1ce(fmla, data = cars)
Error in family(family) :
link "family" not available for gaussian family; available links are
'inverse', 'log', 'identity'
> source(.trPaths[5], echo=TRUE, max.deparse.length=150)
> gl1c.E <- gl1ce(fmla, data = cars, link=identity())
Error in identity() : argument "x" is missing, with no default
In this example I haven't even gotten to the stage of constraining the
coefficients yet because I can't get the function to work with minimal
inputs.
Thanks,
RogerRoger J. Bos, CFA
Rothschild Asset Management, Inc.
Tel +1 (212) 405-5471
Email roger.bos at rothschild.com
1251 Avenue of the Americas, NY, NY 10020
***************************************************************
This message is for the named person's use only. It may\...{{dropped:14}}
More information about the R-help
mailing list