Message Boards Message Boards

5 Replies
2 Total Likes
View groups...
Share this post:

how to curve fit a data file on PRO

Posted 10 years ago
I have a data file with a large number of data points that I would like to curve fit, but every attempt plots just the input data and not the curve fits.

 Presently my data is in a .txt file formated as such:

33, 34, 35, 36, 37, 38, 39, 40.....

I attempted to select the uploaded file and type "fit" after it.  "fit" is always ignored.

How can I curve fit this file using the inbuilt 'FIT' function on
POSTED BY: John Dyess
5 Replies
Posted 10 years ago
says there is a one megabyte upload file size limit.
shows all the file types it can understand.

So I am assuming it can handle your 1900 data points.
The only question will be how to format the file and how to tell
WolframAlpha Pro you want a fitted line and not some other unwanted calculation.

Strictly as a comparison, if you wanted to post your 1900 comma separated points
and check to see that the posting process didn't appear to mangle any of your data
and state that those were y for x=0,x=1,x=2,...x=1900 then in a couple of seconds I'd
do a linear regression and post the result.
POSTED BY: Bill Simpson
Posted 10 years ago
I have approximately 1900 data points.  Do you think that exceeds the limit?  
I shall try with fewer points in the set and see if that works.  

I am logging a temperature gradient on an electrically heated element and I really need the equations that fit the line.  That is the only reason I purchased the subscription.  If I can't get it to do that I have no other use for WA at this time.

Thank you for all your help.
POSTED BY: John Dyess
Posted 10 years ago
Posted 10 years ago
Thank you Bill.  

It looks like you are using Mathematica, and I am simply using WolframAlpha Pro.  I should modify my post to specify that. 

POSTED BY: John Dyess
Posted 10 years ago
Can you modify this to work for your data?
 In[1]:= data = Table[{x, x^2 + RandomReal[{-2, 2}]}, {x, -4, 4}] (*make up some data points*)
 Out[1]= {{-4, 17.4655}, {-3, 9.35509}, {-2, 2.49318}, {-1, -0.0807469},
  {0, -0.417158}, {1, -0.0704794}, {2, 2.71172}, {3, 9.31136}, {4, 15.9621}}
 In[2]:= parabola = Fit[data, {1, x, x^2}, x] (*fit a parabola to the data*)
 Out[2]= -1.17073 - 0.0949574 x + 1.12112 x^2
In[3]:= Show[ListPlot[data], Plot[parabola, {x, -4, 4}]] (*overlay the parabola and the points to check*)

Out[3]= ...plot to see if it worked snipped...
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract