simple linear regression

This is the place for queries that don't fit in any of the other categories.

simple linear regression

Postby tolgaa » Sun Apr 07, 2013 9:49 am

Write a program that calculates the equation of a straight line that best fits a given set of data points.


Inputs:n number of data points {xi,yi}, where i = 1, 2,…, n.


Outputs:The equation of the straight line that best fits to the given set of data points:
y=ax+b
where a is the slope of the line, and b is the intercept. The square of the correlation coefficient, r2.

Hint: Use simple linear regression.
tolgaa
 
Posts: 2
Joined: Sun Apr 07, 2013 9:45 am

Re: simple linear regression

Postby Yoriz » Sun Apr 07, 2013 10:16 am

Hi,

You forgot to add the code you have created so far and which part of it is going you a problem.
Please read the following link.
http://python-forum.org/viewtopic.php?f=6&t=145
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Image
User avatar
Yoriz
 
Posts: 1047
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: simple linear regression

Postby Kebap » Mon May 20, 2013 11:33 pm

tolgaa wrote:Write a program that calculates the equation of a straight line that best fits a given set of data points.


Inputs:n number of data points {xi,yi}, where i = 1, 2,…, n.


Outputs:The equation of the straight line that best fits to the given set of data points:
y=ax+b
where a is the slope of the line, and b is the intercept. The square of the correlation coefficient, r2.

Hint: Use simple linear regression.

Quoted for reference
Learn: How To Ask Questions The Smart Way
Join the #python-forum IRC channel on irc.freenode.net and chat with uns directly!
Kebap
 
Posts: 397
Joined: Thu Apr 04, 2013 1:17 pm
Location: Germany, Europe


Return to General Coding Help

Who is online

Users browsing this forum: gwardlaw and 2 guests