Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Subject
- Posted on
Re: how to put constaints on coefficients obtained from regression.pm
I can't find a top-level module named Regression, so I don't know if it has
any specific capabilities to implement constraints. If not, you could just
iteratively remove any variables that come back with negative coefficients
and rerun the regression.
I'm not sure that this is gauranteed to lead to a globally optimal
solution, but if you are that particular about your statistical rigour, you
probably should probably be using a commercial regression application
anyway.
Xho
--
-------------------- http://NewsReader.Com / --------------------
Usenet Newsgroup Service $9.95/Month 30GB
Re: how to put constaints on coefficients obtained from regression.pm
Huh? That's really strange. Regression coefficients sometimes just ARE
negative because that's the way the data is. You can transform the data
so that the coefficients are more meaningful, e.g.; taking the log or
something, but when you fit a model to your data you have to accept
what the data says, not what you want it to be. That is, if you're
honest.
Ask in a statistics group; I think they'll tell you the same thing. For
what it's worth, my job title is statistician (although I tend to do
more programming these days) and I've never heard of trying to force
all regression coefficients to be positive. The PhD statistician across
the hall (I only have a Master's in stat) hadn't either. He said it
sounded like something a psychologist would try to do. :-)
Re: how to put constaints on coefficients obtained from regression.pm
Sounds like you want a program like lp_solve:
http://www.cs.sunysb.edu/~algorith/implement/lpsolve/implement.shtml
along with a bunch of other sites.
That's one that you probably don't want to reinvent in Perl.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
Site Timeline
- » FAQ 1.3 Which version of Perl should I use?
- — Next thread in » PERL Discussions
- » $SIG and system
- — Previous thread in » PERL Discussions
- » s suffix question
- — Newest thread in » PERL Discussions
- » Dell Battery Slice LED codes
- — The site's Newest Thread. Posted in » Laptop Computers Forum