BoredDanMan
Newcomer
- Joined
- Mar 6, 2013
- Sythe Gold
- 0
- Messages
- 1
First I'd like to say that I had an old account on Sythe long ago when I was into runescape and botting and all that jazz, but now that I've gotten older and am not really playing runescape anymore, I remembered that Sythe also had a section on the forums for programming. I'm getting into programming, and I figured the first language I should learn is probably C. I'm now trying to make a code that will do the following things, but I don't really know where to start.
1). Accept some form of user input whether it's from a file or typed in for 10 ordered pairs (x and y variables, both float). At the moment i just have two arrays, one for x and one for y.
2). Use simple linear regression to calculate the best fit line for the given points
3). print the best fit line and r value
Note I have never actually taken statistics so I'm using my calc knowledge and wikipedia to understand how Linear Regression works. Finding the r value seems annoying and I dont really get it.
Update: I've figured it out except for a small problem. When doing the linear regression with certain data sets there is a divide by 0 error and I cant seem to fix it
1). Accept some form of user input whether it's from a file or typed in for 10 ordered pairs (x and y variables, both float). At the moment i just have two arrays, one for x and one for y.
2). Use simple linear regression to calculate the best fit line for the given points
3). print the best fit line and r value
Note I have never actually taken statistics so I'm using my calc knowledge and wikipedia to understand how Linear Regression works. Finding the r value seems annoying and I dont really get it.
Update: I've figured it out except for a small problem. When doing the linear regression with certain data sets there is a divide by 0 error and I cant seem to fix it




















































