I tried this unsuccessfully:
find_fit(data, quadratic_residues)
I am trying to find the best-fit for data about water flow rates: http://dl.getdropbox.com/u/175564/rate.png
---edit after the comment---
The new code:
var('x')
model(x) = x**2
find_fit((xlist, reqlist), model)
The error message:
Traceback (click to the left for traceback)
...
TypeError: data has to be a list of lists, a matrix, or a numpy array
---edit
The error message is now:
Traceback (click to the left for traceback)
...
ValueError: each row of data needs 2 entries, only 5 entries given
The same here as a picture: http://dl.getdropbox.com/u/175564/sage.png
It consists of 3 stages – (1) analyzing the correlation and directionality of the data, (2) estimating the model, i.e., fitting the line, and (3) evaluating the validity and usefulness of the model. First, a scatter plot should be used to analyze the data and check for directionality and correlation of data.
You can use SPSS software to perform regression analysis, it is simple and efficient software.
Select Tools->Regression Test from the main menu or use the right-click menus of the Regression Folder in the Project Explorer to launch the Regression Test Wizard that allows you to create and edit Regression Command/Script files. To run an existing Regression Test Script, select Execute.
mydata = [[1,3],[2,7],[3,13],[4,24]]
var('a,b,c')
mymodel(x) = a*x^2 + b*x + c
myfit = find_fit(mydata,mymodel,solution_dict=True)
points(mydata,color='purple') + plot(
mymodel(
a=myfit[a],
b=myfit[b],
c=myfit[c]
),
(x,0,4,),
color='red'
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With