Thank you for your time and consideration.................<br><br><div class="gmail_quote">On Wed, Mar 16, 2011 at 5:17 PM, Angus McMorland <span dir="ltr"><<a href="mailto:amcmorl@gmail.com">amcmorl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 16 March 2011 02:53, dileep kunjaai <<a href="mailto:dileepkunjaai@gmail.com">dileepkunjaai@gmail.com</a>> wrote:<br>

> Dear sir,<br>
>  Can we do multiple linear regression(MLR)  in python.... is there any<br>
> inbuilt function for MLR<br>
<br>
</div>Yes, you can use np.linalg.lstsq [1] for this.<br>
Here's a quick example:<br>
<br>
import numpy as np<br>
# model is y = b0.x0 + b1.x1 + b2.x2<br>
b = np.array([3.,2.,1.])<br>
noise = np.random.standard_normal(size=(10,3)) * 0.1<br>
bn = b[None] + noise<br>
x = np.random.standard_normal(size=(10,3))<br>
y = np.sum(bn * x, axis=1)<br>
be = np.linalg.lstsq(x,y)<br>
<br>
and be[0] should be close to the original b (3,2,1.).<br>
<br>
[1] <a href="http://docs.scipy.org/doc/numpy-1.4.x/reference/generated/numpy.linalg.lstsq.html" target="_blank">http://docs.scipy.org/doc/numpy-1.4.x/reference/generated/numpy.linalg.lstsq.html</a><br>
<br>
> --<br>
<div><div></div><div class="h5">> DILEEPKUMAR. R<br>
> J R F, IIT DELHI<br>
</div></div><font color="#888888">--<br>
AJC McMorland<br>
Post-doctoral research fellow<br>
Neurobiology, University of Pittsburgh<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>DILEEPKUMAR. R<br>J R F, IIT DELHI<br><div style="display: inline;"></div><br>