Summary
We calculated the correlation of the stock returns of two stocks with the corrcoef
function. As a bonus, a demonstration of the diagonal
and trace
functions was given, which can give us the diagonal and trace of a matrix.
We fit data to a polynomial with the polyfit
function. We learned about the polyval
function that computes the values of a polynomial, the roots
function that returns the roots of the polynomial, and the polyder
function that gives back the derivative of a polynomial.
Hopefully, we increased our productivity so that we can continue in the next chapter with matrices and universal functions (ufuncs
).