Kernel: Python 3 (system-wide)
In [1]:
Regresión
Por minimos cuadrados
Regresión Lineal
Obteniendo las siguientes derivadas parciales e igualandolas a cero:
In [2]:
In [3]:
In [4]:
In [5]:
Out[5]:
16.56
In [6]:
Out[6]:
array([ 1.17818182, 2.71636364, 4.25454545, 5.79272727, 7.33090909,
8.86909091, 10.40727273, 11.94545455, 13.48363636, 15.02181818])
In [7]:
Out[7]:
[<matplotlib.lines.Line2D at 0x7fdcca5a5850>]
In [8]:
Out[8]:
16.56
In [9]:
Out[9]:
[-1.11113369e+02 6.37614170e-02]
[<matplotlib.lines.Line2D at 0x7fdcca4f7f70>]
In [10]:
Out[10]:
20.235150192960518
In [11]:
Out[11]:
[ 1.42513095e+03 -7.02380952e-01]
[<matplotlib.lines.Line2D at 0x7fdcca47ffa0>]
In [12]:
Out[12]:
-0.7023809523809632
Regresion cuadratica
In [13]:
In [14]:
Out[14]:
array([[ 1., 0., 0.],
[ 1., 2., 4.],
[ 1., 3., 9.],
[ 1., 5., 25.]])
In [15]:
In [16]:
Out[16]:
array([-1.15384615, 1.29487179, -0.16666667])
In [22]:
Out[22]:
p(x) = -1.15+1.29 x -0.17 x^2
[<matplotlib.lines.Line2D at 0x7fdcc82b5580>]
In [0]: