Ask Your Question

Revision history [back]

I am not sure to understand your question. Does the following answer it ?

sage: sol = find_fit(r, model)
sage: a,b = (sol[0].rhs(), sol[1].rhs())
sage: f(x) = model.subs(a=a,b=b) ; f
x |--> 2.8690476190478367*x + 76.70833333333225
sage: f(15)
119.74404761904981

I am not sure to understand your question. Does the following answer it ?

sage: sol = find_fit(r, model)
sage: a,b A,B = (sol[0].rhs(), sol[1].rhs())
sage: f(x) = model.subs(a=a,b=b) model.subs(a=A, b=B) ; f
x |--> 2.8690476190478367*x + 76.70833333333225
sage: f(15)
119.74404761904981