Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168733
Image: ubuntu2004
y = vector([10,7,5,4,3,3,4,5,8,10]);y
\newcommand{\Bold}[1]{\mathbf{#1}}\left(10,\,7,\,5,\,4,\,3,\,3,\,4,\,5,\,8,\,10\right)
X = matrix([[1,1,1],[1,2,4],[1,3,9],[1,4,16],[1,5,25],[1,6,36],[1,7,49],[1,8,64],[1,9,81],[1,10,100]]);X
\newcommand{\Bold}[1]{\mathbf{#1}}\left(111124139141615251636174918641981110100\begin{array}{rrr} 1 & 1 & 1 \\ 1 & 2 & 4 \\ 1 & 3 & 9 \\ 1 & 4 & 16 \\ 1 & 5 & 25 \\ 1 & 6 & 36 \\ 1 & 7 & 49 \\ 1 & 8 & 64 \\ 1 & 9 & 81 \\ 1 & 10 & 100 \end{array}\right)
T = X.transpose()
woop = ((T*X)^-1)*T*y;woop
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\frac{40}{3},\,-\frac{417}{110},\,\frac{23}{66}\right)
def f(x): return woop[0] + woop[1]*x + woop[2]*x^2 var(x) plot(f(x), -2, 12, color='red')