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
Follow Simple Linear Regression
Other Useful Business Software
AI-powered service management for IT and enterprise teams
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.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of Simple Linear Regression!