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

You Might Also Like
Bright Data - All in One Platform for Proxies and Web Scraping Icon
Bright Data - All in One Platform for Proxies and Web Scraping

Say goodbye to blocks, restrictions, and CAPTCHAs

Bright Data offers the highest quality proxies with automated session management, IP rotation, and advanced web unlocking technology. Enjoy reliable, fast performance with easy integration, a user-friendly dashboard, and enterprise-grade scaling. Powered by ethically-sourced residential IPs for seamless web scraping.
Get Started
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