Posts

Python meets linear algebra

Python meets linear algebra Statistics and linear algebra seem like a pair that should always be married to each other. This is hardly the case however. If you are like me and you fancy remembering the equation for say the correlation between two variables without memorizing the formula, then you should probably pick a linear algebra text by Gilbert Strang or head over to his MIT vidoes on youtube which can be found here . Trust me this will be very illuminating. I will give some examples in case you are still not convinced. We have two variables x = [ 1 2 3 4 5 6 ] y = [ 7 8 9 10 11 12 ] Pardon my lack of creativity but these two vectors will do. If you wanted to calculate the correlation between these two vectors(variables), from statistics we would need to do C o v ( x , y ) σ x σ y ​ . Step in linear algebra and the correlation between two vectors(variables) is basically the angle between the two variables given by c o s θ = x → . y → | x | | y . Comparing these two equat...