Algorithm:

Step 1. Read n
Step 2. sumx = 0
Step 3. sumxsq = 0
Step 4. sumy = 0
Step 5. sumxy = 0
Step 6. for i = 1 to n do
Step 7. Read x, y
Step 8. sumx = sumx + x
Step 9. sumxsq = Sumxsq + x2
Step 10. sumy = Sumy + y
Step 11. sumxy = sumxy + x * y end for
Step 12. denom = n * sumxsq – sumx * sumx
Step 13. a0 = (sumy * sumxsq – sumx * sumxy) / denom
Step 14. a1 = (n * sumxy - sumx * sumy) / denonm
Step 15. Write a1, a0
Step 16. Stop

Project Activity

See All Activity >

Follow Simple Linear Regression

Simple Linear Regression Web Site

Other Useful Business Software
AI-powered service management for IT and enterprise teams Icon
AI-powered service management for IT and enterprise teams

Enterprise-grade ITSM, for every business

Give your IT, operations, and business teams the ability to deliver exceptional services—without the complexity. Maximize operational efficiency with refreshingly simple, AI-powered Freshservice.
Try it Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Simple Linear Regression!

Additional Project Details

Registered

2015-08-16