# Fitting a very simple dataset

Posted 5 months ago
681 Views
|
3 Replies
|
1 Total Likes
|
 Hi all,I am a beginner in Mathematica. I am trying to fit the data from a CSV file using FindFit. In doing so, I am getting the following error message FindFit::nrjnum: The Jacobian is not a matrix of real numbers at {a} = {1.}. My CSV file can be found attached. I wonder what is the right way of performing this task. I would like to fit my data into something of the form: y = 1/x^{a} My attempt so far has been data=Import["/home/data_variance2_r \_final.csv"] modeltwolevelsat = 1/x^a; eq = FindFit[data, modeltwolevelsat, {a}, x] I would appreciate if someone can help me out or give any tip on how to solve this problem. Thanks in advance. Attachments:
3 Replies
Sort By:
Posted 5 months ago
 Hi Heitor,Look at what the function evaluates to over the data. ClearAll@modeltwolevelsat; modeltwolevelsat[x_, a_] = 1/x^a modeltwolevelsat @@@ data (* Result is imaginary *)