Multiple linear Regression

Open discussion regarding features, bugs, issues, vendors, etc.

Multiple linear Regression

Postby wd20lp » Thu Jun 09, 2005 8:32 am

Dear All,

I am a new LAPACK user and I would like to
do a Multiple linear Regression. However I am
not sure which routines (or driver) to use.
Does anybody have something on this line,
or can help me?
Thank you,

Posts: 7
Joined: Thu Jun 09, 2005 8:24 am

Postby Julien Langou » Thu Jun 09, 2005 10:29 am

Given A, an m-by-n matrix with m >=n, and B a vector of size m, the routine DGELS (or S/D/C/Z-GELS) solves the least squares problem
minimize || B - A*X ||_2 over all vector X of size n.

Multiple linear regression problems end up with a linear least squares problem so you can use LAPACK routine DGELS to eventually solve your problem.

Note that you are responsible for constructing the matrix A and B.

For example, if you simply want to solve the multiple linear regression problem
Y = a + b1*X1 + b2*X2 + ... + bp*Xp
then you set
A = [ ones, X1, X2, ... Xp ] , where A is a m-by-(p+1) matrix, ones is the vector of m ones, each column j of A represents the values of the variable Xj at the m different points
B = Y, B is a vector of size m with the values of the variable Y at the m different points
DGELS returns you the vector X of size (p+1) with the regression coefficient:
X = [ a, b1, b2, ... bp ] (in a column not in a line as written).
Julien Langou
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Postby wd20lp » Fri Jun 10, 2005 4:22 pm

Dear Julien,
Thanks a lot for your help!

Posts: 7
Joined: Thu Jun 09, 2005 8:24 am

Postby mbibby » Sat Jun 25, 2005 4:04 pm

Luciano, how is the Multiple Linear Regression going? Do you need anymore help?

Posts: 12
Joined: Sun Jun 12, 2005 1:12 pm
Location: MA

Postby wd20lp » Mon Jun 27, 2005 11:09 am

Hi Malcom

Apparently is working. I haven't tested extensivelly. However
any comment is welcome. Actually if you have suggestions
about implementation of any complementary statistics calculation
for Muliple Linear Regression it will be usefull (e.g., confidence intervals, etc...)


Posts: 7
Joined: Thu Jun 09, 2005 8:24 am

Return to User Discussion

Who is online

Users browsing this forum: No registered users and 8 guests