Author |
Topic: How to code polynomial Regression (Read 803 times) |
|
CharlesB
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: How to code polynomial Regression
« Reply #4 on: Apr 24th, 2015, 4:13pm » |
|
Thank you Richard. This worked for me!
Also, I read the section on *LOWERCASE and the Star command summary ... learned a few very helpful things.
Further, I downloaded your polyfit.exe and it was a work of beauty. But when I downloaded polyfit.bas and looked into the code, it seems to me that the program looks for a polyfit.csv file in its own directory. I created such a file of about three hundred lines for x,y values. However, when I "Load & plot file" I see no dots, and when I "Fit polynomial," I get very strange results.
I'm not sure what I did wrong, but in any case, I thank you for your help.
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: How to code polynomial Regression
« Reply #5 on: Apr 24th, 2015, 5:16pm » |
|
on Apr 24th, 2015, 4:13pm, CharlesB wrote:| However, when I "Load & plot file" I see no dots... I'm not sure what I did wrong. |
|
Did you modify the program to account for the hugely reduced number of data points? If you didn't, your data will be squashed into only about 1.5% of the width of the plot and inevitably the fitted polynomial is likely to 'blow up' outside that range.
The code at the website is just a demonstration, and is not designed to accept an arbitrary data file (e.g. it doesn't automatically scale the plot to the number and range of values in the file); it doesn't even allow you to choose the degree of polynomial!
The hope is that the code is structured in such a clear way that it is easy to modify to your own requirements.
Richard.
|
|
Logged
|
|
|
|
CharlesB
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: How to code polynomial Regression
« Reply #6 on: Apr 24th, 2015, 9:15pm » |
|
Thank you Richard; I knew that it was a demonstration program and I did notice that it was only designed for a five degree polynomial . . . but I'm such a novice that I did not recognize the need to modify the program for the small data file.
It gives me something to learn. You are absolutely right, my regression line was "blown up" outside the range.
|
|
Logged
|
|
|
|
|