Numpy and Scipy: Using Sparse Matrices to Speed up Calculations (part 1)

  Рет қаралды 4,988

Kevin Mooney

Kevin Mooney

Күн бұрын

In response to a comment on the videos dealing with Monte Carlo models of stocks market movement, and how to calculate the probability of making 50% of max profit on an options trade, I want to revisit some of the concepts presented in those videos. In particular the concept of linear systems which can be represented by matrix equations where the coefficient matrix is sparse. I will go through the calculations used in these videos and show, step-by-step, how the matrices involved are generated. This will be part one of three where we show how sparse matrices and linear algebra are used to speed up calculations. Part two will deal with solving a partial differential equation. Part three will return to to the matrices used in the Monte Carlo calculation.
Github: github.com/kpm...
Probability of making 50%: • Monte Carlo Techniques...
Probability of a Touch: • Probability of a Touch...
Tip Jar: paypal.me/kpmo...

Пікірлер: 9
@0mon0zz
@0mon0zz 3 жыл бұрын
Good vid! But what about solving a system of non-linear equations that have large sparse matrices?
@AJ-et3vf
@AJ-et3vf 3 жыл бұрын
Thank you so much for this. Very useful.
@RajeshSingh-hx2sc
@RajeshSingh-hx2sc Жыл бұрын
But at 8:43, Ainv is not really an identity matrix, right? (since, its non diagonal elements are not zeros) Or Am I missing something?
@fai212
@fai212 Жыл бұрын
Yes they are, all of them have a value very very very close to zero which means 0. I think the reason is because of the computer.
@kpmooney
@kpmooney Жыл бұрын
There are always rounding errors involved. The off-diagonals are essentially zero within machine precision.
@hardikkharel3519
@hardikkharel3519 3 жыл бұрын
can we do it in any ide without juypter notebook?
@kpmooney
@kpmooney 3 жыл бұрын
Yes, of course. Copy and paste the code into an editor.
@adamfit9158
@adamfit9158 Жыл бұрын
What about sparse matrix + sparse matrix
@kpmooney
@kpmooney Жыл бұрын
Yes, you can do that.
Basics of Linear Algebra for AI and ML [with code]: Part 1
36:37
小丑家的感情危机!#小丑#天使#家庭
00:15
家庭搞笑日记
Рет қаралды 34 МЛН
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 15 МЛН
NumPy vs SciPy
7:56
IBM Technology
Рет қаралды 41 М.
Linear Systems and Sparse Matrices with Numpy and Scipy
20:39
Kevin Mooney
Рет қаралды 13 М.
How AI Discovered a Faster Matrix Multiplication Algorithm
13:00
Quanta Magazine
Рет қаралды 1,5 МЛН
Make Python code 1000x Faster with Numba
20:33
Jack of Some
Рет қаралды 445 М.
Python: use SPARSE matrices to BOOST numpy performance!
10:07
Jose A. Abell M.
Рет қаралды 1,8 М.
Iterative methods for sparse linear systems on GPU (1)
48:04
Boston University
Рет қаралды 4,8 М.
How to Make Graphs Like The Athletic in Python
31:38
McKay Johns
Рет қаралды 38 М.
The Fastest Way to Loop in Python - An Unfortunate Truth
8:06
mCoding
Рет қаралды 1,4 МЛН