Gentle Introduction to Modeling with Matrices and Vectors: A Probabilistic Weather Model

Ғылым және технология

This video gives an intro example of how we model complex systems that change in time, using matrices and vectors. Specifically, I build a toy model for the weather, where the probability of the weather today being "(R)ainy", "(N)ice", or "(C)loudy" is stored in a vector [R, N, C]. This probability of the weather being in one of these states tomorrow is then updated by multiplying this vector by a probability matrix.
Code examples are given in Python and Matlab.
Playlist: • Engineering Math: Diff...
Course Website: faculty.washington.edu/sbrunto...
@eigensteve on Twitter
eigensteve.com
databookuw.com
This video was produced at the University of Washington
%%% CHAPTERS %%%
0:00 Overview
1:07 Building a simple weather model
5:00 Modeling the state as a vector
6:50 Writing the dynamical system update rule as a matrix
14:07 Matlab code example
23:43 Python code example
38:24 Teaser of how to make system more realistic

Пікірлер: 97

  • @wentaowu3070
    @wentaowu30706 ай бұрын

    As a university professor, Ii would say Steve's lectures are amazing. there are a lot to learn, not only knowledge but also how to teach

  • @Eigensteve

    @Eigensteve

    6 ай бұрын

    Thank you for your kind words! I'm glad you find them helpful :)

  • @rudypieplenbosch6752
    @rudypieplenbosch6752 Жыл бұрын

    Its clear Steve loves his work, I am a big fan of these lectures.

  • @eunhyebaek2775
    @eunhyebaek277514 күн бұрын

    Best lecture ever! Thank you, Prof. Brunton. If I had learned like this in university, my life would have been different....

  • @user-gg7ux4co8d
    @user-gg7ux4co8d6 ай бұрын

    I find my self very fortunate to find Teacher like you.

  • @dangquocbao9504
    @dangquocbao95047 ай бұрын

    I am truly happy when I found out this channel and your educational playlist. Thanks a lot.

  • @balooleffe
    @balooleffe Жыл бұрын

    Thank you, you are an amazing person to take the time to share your knowledge.

  • @theminertom11551
    @theminertom11551 Жыл бұрын

    Steve, your lectures are simply amazing!

  • @georgesngona7032
    @georgesngona7032 Жыл бұрын

    Thank you for bringing complex ideas into simple, easy to digest ideas with your lectures

  • @bandaragunarathna4340
    @bandaragunarathna4340 Жыл бұрын

    Fantastic. Dear professor - you are a gift to the humanity!

  • @michaelwood2292
    @michaelwood2292 Жыл бұрын

    This The BEST video I've seen that shows the process (however simple) of creating a model and then using math/computer to model. A++ to you Steve!!!

  • @jacobpeyron
    @jacobpeyron Жыл бұрын

    Well done. I'm a professional programmer (whatever that means) and you put joy and mathematics into my heart

  • @laurielgm
    @laurielgm Жыл бұрын

    I am passionnated by your lectures! I could listen to you for hours!!! Thank you soooo so much for those videos! Having a special background it a hard for me to follow by myself only by books but this gives me so much motivation, thank you so so so much !!!

  • @guido.demedici
    @guido.demedici Жыл бұрын

    One of the best lectures since Feynman

  • @creo_one
    @creo_one Жыл бұрын

    Outstanding content, gonna try experimenting with the concepts on my own, thanks.

  • @hoseinzahedifar1562
    @hoseinzahedifar1562 Жыл бұрын

    Thank you, sir... for this excellent concept.🙏🙏

  • @willykitheka7618
    @willykitheka7618 Жыл бұрын

    I stumbled upon your channel!!!😁😁😁😁😁...you should know I consider myself very lucky! The concepts are very well explained. I have a project am working on, so the information I glean from here is going to help a lot! Thank you very much for sharing!

  • @hasibulhaque9452
    @hasibulhaque9452 Жыл бұрын

    Great JOB, Professor ❤

  • @JousefM
    @JousefM Жыл бұрын

    Awesome as always, Steve!

  • @almirbravin1
    @almirbravin1 Жыл бұрын

    FANTASTIC

  • @mauriciocarazzodec.209
    @mauriciocarazzodec.209 Жыл бұрын

    I wish you were my professor back in time! Looking forward to meet you someday and thank you for all you've done to your students.

  • @martian.07_
    @martian.07_ Жыл бұрын

    I'm loving this

  • @MLDawn
    @MLDawn11 ай бұрын

    Has anyone ever told you that you are a legend?! I am a huge fan!

  • @martian.07_
    @martian.07_ Жыл бұрын

    This is peice of Art, I can understand how much work goes behind these lectures, may God give you more power.

  • @Eltrissi
    @Eltrissi Жыл бұрын

    Just a great work. Thanks

  • @gowildamit1463
    @gowildamit1463 Жыл бұрын

    Much better way to explain. Have to say. Thanks man

  • @higiniofuentes2551
    @higiniofuentes2551 Жыл бұрын

    Thank you for this very interesting video!

  • @diveintoengineering6089
    @diveintoengineering6089 Жыл бұрын

    Thank you Prof. Brunton!

  • @danhvo2702
    @danhvo270222 күн бұрын

    Thank you for your lecture

  • @violaye3785
    @violaye3785 Жыл бұрын

    thank you very much! you make maths so interesting and attractive!

  • @sashaa9382
    @sashaa9382 Жыл бұрын

    Thank you, very interesting video. I would also like to add on my own about the features of the numpy library. A column vector can also be written as a row vector, and if, when multiplying the first one, you specify a matrix, and the second is our row vector, then the numpy library will automatically convert it into a column vector for calculations. This is done for convenience, since when working with vectors, it is quite difficult to constantly write them down and work with them as a column due to the syntax. But here it is important to be careful, because the vector still remains in the row vector notation format. Example: M = np.array([ [a11, a12, a13], [a21, a22, a23], [a31, a32, a33] ]) b_vec = np.array([b11, b12, b13]) - row-vector But if we: M @ b - so in this case won`t be any mistakes. Numpy will automaticly convert b into column-vec and will make correct calculations. And of course if we will multiply them in this way: b @ M - there won`t be any mistake too, because we multiply Matrix (row-vec)1x3 to Matrix 3x3. And we will have another resault

  • @brunotrotti6942
    @brunotrotti6942 Жыл бұрын

    Great video ! Please keep going

  • @ramkitty
    @ramkitty Жыл бұрын

    I maintain weather stations and have a station near tofino bc not far from seattle and it has received over 10m rain annually. We were there once and the 0.2mm bucket tips were audible at 2/s

  • @ireoluwaTH
    @ireoluwaTH Жыл бұрын

    It's a great experience learning these concepts with a fresh, application-oriented eye. Could you please include the link to the Jupyter Notebook? Great content always, thanks!

  • @nhlhockeyallstar
    @nhlhockeyallstar Жыл бұрын

    thank you professor

  • @afammadudaniel2982
    @afammadudaniel2982 Жыл бұрын

    I love it.

  • @muhammadmobeen8682
    @muhammadmobeen8682 Жыл бұрын

    fabulous and brilliant 😍😍😍😍 ...

  • @MuhammadAfzal-zi9ln
    @MuhammadAfzal-zi9ln Жыл бұрын

    sir steve brunton excellent lecture

  • @bryan-9742
    @bryan-9742 Жыл бұрын

    Love it! this is a bit easier to see it: for k, ii in enumerate(range(50)): xtomorrow = A@x_today print(f"{k}: {xtomorrow} ") x_today = xtomorrow

  • @Polynikes18
    @Polynikes18 Жыл бұрын

    how would the eigenvalues & eigenvectors relate to this system and the stable values as k increases?

  • @sumanyuaggarwal8460
    @sumanyuaggarwal8460 Жыл бұрын

    Thank you

  • @An_Attempt
    @An_Attempt Жыл бұрын

    Thanks very much for the python. Free software is fantastic.

  • @dancollins1012

    @dancollins1012

    Жыл бұрын

    Octave is an free open source version of Matlab, so you don't need to use Python

  • @An_Attempt

    @An_Attempt

    Жыл бұрын

    @@dancollins1012 Thanks for the suggestion, I have tried Octave. The problem that I keep running into is that it is just a tiny bit different than Matlab, which results in a lot of debugging. The main advantage to Octave and Matlab have over python is that they tend to be more succinct. Python is more useful (mostly because of the large quantity of libraries) as general programming language .

  • @dancollins1012

    @dancollins1012

    Жыл бұрын

    @@An_Attempt Yes, I know what you mean, Octave does have slight differences. I'm hoping that the examples in this great video series are not so lengthy or complex that it's a problem. I also perceive (may be wrong) that Octave incompatibilities with Matlab are reducing over time. Personally, I can't stand Python, so I'll just make Octave work for me. I guess you, I and others could post debugged Octave code on GitHub and share the fun that way

  • @konnen4518
    @konnen4518 Жыл бұрын

    What book would give me an in-depth intuition into using vectors and matrices to model real world problems? Any recommendations?

  • @user-iv9nj9nx8q
    @user-iv9nj9nx8q8 ай бұрын

    The numpy package in Python treats column vectors and row vectors the same. That is why it gave a ValueError. It handles vectors as an order-1 tensor and handles if it's a covariant covector (row vector) or a contravariant (column) vector based on whether its the first or second argument in the dot product / matrix multiplication (@) operation. So in this example, just making the vector a "row" vector would suffice and it would be treated as a column vector when it's on the right side of the @ operator.

  • @PaulA-kr1nl
    @PaulA-kr1nl Жыл бұрын

    If you're used to indexing from 1, try Julia programming language. It too starts its index at 1.

  • @venugopalt6861
    @venugopalt6861 Жыл бұрын

    do you think is the A matrix correct , as i see you gave rain 0.5 and rest 0.25 , similarly for earch combination it will be 0.5 and 0.25 respectively , please clarify on this

  • @HojaUno
    @HojaUno Жыл бұрын

    Steve, question about the eigenvectors . To demonstrate that the probability obtained by the simulation. It was the same as the one from the eigenvector -you choose the first column to normalize it. Why the other columns don't have that information? How did you know which column to pick? 🤔💭

  • @SSNewberry
    @SSNewberry3 ай бұрын

    In Seattle, we can have 3 model states: rainy, showery, and drizzly.

  • @HAGARCIA
    @HAGARCIA Жыл бұрын

    Geometry world: S=a+b; Sum is equal to a plus b ;;; Computing world: a

  • @charlesspringer4709
    @charlesspringer4709 Жыл бұрын

    Do you have any info on how thise video is made?

  • @TheLawlbreaker
    @TheLawlbreaker Жыл бұрын

    No mention of Markov chains?

  • @richardharding6845
    @richardharding684510 ай бұрын

    how do you write backwards?

  • @martinsanchez-hw4fi
    @martinsanchez-hw4fi Жыл бұрын

    For the multiplication Ax yo represent the total probability shouldn't you be working with A transpose (each entry i,j being the probability of going from i to j)?

  • @karatsurba4791

    @karatsurba4791

    Жыл бұрын

    Could you kindly rephrase your question. What seems ambiguous is your reference to the transpose. Hope that helps

  • @charlie3k
    @charlie3k Жыл бұрын

    Great video! I have some questions about the transition matrix A. Why are the probabilities in matrix A organized in that particular manner (the columns are conditions today and rows are conditions tomorrow). But what is stopping someone from reversing that order, where the columns are instead conditions tomorrow and the rows are conditions today?

  • @georgebethel1320

    @georgebethel1320

    Жыл бұрын

    You can't do that vector x is a column vector with each row representing the probability of the weather. You also want to make sure that the resulting vector, after multiplying it by the A matrix is a column vector of the same form as the first vector representation. My point is, you're looking for x tomorrow and for that, tomorrow can't be at the top. It has to be by the side

  • @higiniofuentes2551
    @higiniofuentes2551 Жыл бұрын

    Despite the fact that all is clear, I'm lost when you define ax1, ax2 etc and then you said a2x1 is the third element? Thank you!

  • @iheavense
    @iheavense Жыл бұрын

    Is the recording speeded up?

  • @meir.zeilig-hess
    @meir.zeilig-hess Жыл бұрын

    I wonder how could the "nice" probability converge to 0.2 if at any timestep is has 0 probability to stay "nice". I mean, if we think about these states as 3 bins for particles, then the 0 probability to get "nice" tomorrow is translated to a statistically constant migration of particles from the "nice" bin to the other two, so that in time I would expect to be left with no particles in the "nice" bin. Am I missing something?

  • @meunomemauricio

    @meunomemauricio

    Жыл бұрын

    The part that is missing is that there are still "particles migrating" from rainy/cloud into nice. The weather never stays nice for more than a day, but it can still become nice after a rainy or cloudy day (albeit with a smaller probability).

  • @Abhishekkumar-hi3mu
    @Abhishekkumar-hi3mu Жыл бұрын

    How can he write backwards

  • @nigelhill74
    @nigelhill749 ай бұрын

    Great video. A small point on language, traditionally code, referring to computer code, has been treated only as a class of thing, not as an individual item. So in the past we traditionally said "I have 3 pieces of code" not "I have 3 codes". This is kind of important for people who are learning coding as they often think that software code is a literal code like a cypher for passing secret messages. And then they can picture 3 codes as 3 modified versions of one thing, different cyphers. Clearly they can get past this quickly, but working in a software company and interacting with non-technical people this can present significant challenges in communication. I'm guessing that amongst the younger generation this horse has bolted and there is no going back. Especially with the world getting smaller and people with English as a second language tending to struggle with this concept (my co-worker is always referring to multiple "stuffs" when stuff should never be pluralised) it seems that the English language is rapidly changing to discard nouns that are only ever classes of things. So it seems to be very accepted these days to say "these Python CODES that I'm running" versus "this Python CODE that I'm running", or "I did so many STUFFS on the weekend" versus "I did so much STUFF on the weekend". So be it, but I for one am lamenting this change... One last point, although the video is only an introduction it seems unfortunate to model something that converges like that rather than a more interesting example that is more chaotic. It's fine though to have such a cheesy toy model. Great video over all. Thank you

  • @freeenergymachineforsale9751

    @freeenergymachineforsale9751

    9 ай бұрын

    Not sure if this is helpful, but the term for this is "uncountable." Code and stuff are both uncountable nouns.

  • @nigelhill74

    @nigelhill74

    9 ай бұрын

    @@freeenergymachineforsale9751 nice, thanks

  • @Cambyand1
    @Cambyand1 Жыл бұрын

    Also great Gorillaz reference

  • @jedi10101
    @jedi10101 Жыл бұрын

    Markov chain or Markov process

  • @ryanhewitt9902
    @ryanhewitt99029 ай бұрын

    It just occurred to me that Dr. Brunton is probably flipping these videos, and is in fact not an expert in writing backwards.

  • @pureatheistic
    @pureatheistic5 ай бұрын

    So do you write backwards, or do you just flip the video?

  • @jergin4596
    @jergin4596 Жыл бұрын

    Oh, I'm a graduate student at UNT! Small world

  • @BsktImp
    @BsktImp Жыл бұрын

    Wil modelling like this disappear with more 'black box' machine learning/AI approaches?

  • @karatsurba4791

    @karatsurba4791

    Жыл бұрын

    Highly unlikely.

  • @alexanderskusnov5119
    @alexanderskusnov5119 Жыл бұрын

    It is called Markov chains.

  • @afammadudaniel2982

    @afammadudaniel2982

    Жыл бұрын

    Beautiful stuff.

  • @afammadudaniel2982

    @afammadudaniel2982

    Жыл бұрын

    Is it different from graph?

  • @basics5427

    @basics5427

    Жыл бұрын

    @@afammadudaniel2982 You can use graph as the mathematical tool to represent lots of problems, e.g. connectivity of points in a physical grid (streets, gas or electricity networks, water pipes), logical relationships between elements, transition in time between states of the system (here) for Markov processes (or chains). Markov Process (or Markov chains) are also the basis of Reinforcement Learning. You can model a stochastic process as: - Markov Process, MP: states, and transitions (probability of) between states; - Markov Reward Process, MRP: states, transitions and rewards associated with transitions; - Markov Decision Process, MDP: states, transitions, set of actions that can be made, rewards. Main goal of Reinforcement Learning is to find the best actions to perform to optimize a total reward

  • @TheEicio
    @TheEicio Жыл бұрын

    I don’t see the links to the code

  • @fabricetshinangi5042

    @fabricetshinangi5042

    Жыл бұрын

    click on course website, the code is under Syllabus, part 1, Lecture 1

  • @TheEicio

    @TheEicio

    Жыл бұрын

    @@fabricetshinangi5042 Thanks. That is only the Matlab code, not the Python code he refers to in the video.

  • @An_Attempt

    @An_Attempt

    Жыл бұрын

    @@TheEicio It needs to be updated. I think this is a remake of an old class, and he is adding python gradually.

  • @jesperheuver5779

    @jesperheuver5779

    Жыл бұрын

    @@TheEicio seems like the python code is up now!

  • @ermayankverma
    @ermayankverma Жыл бұрын

    Thank you for this wonderful lecture Prof. Brunton. Big fan of your teaching skills. I just have a small doubt about the probability matrix. To map x2 from x1, we have a probability matrix A such that x2=Ax1. And then mapping from x2 to x3, we have another probability matrix "A", such that x3=Ax2. you have considered the same A matrix for all three days. In reality, will not there be two different A matrices for three different x (x1, x2, x3)? Why we are taking them same matrix for all the remianing days as well? Or this matrix A is universal for all the x?

  • @karatsurba4791

    @karatsurba4791

    Жыл бұрын

    Albeit I'm not the prof, I know the answer to your Q. Yes, your understanding is correct, i.e. the probability matrix is updated after each iteration.

  • @shreddingstranger

    @shreddingstranger

    Жыл бұрын

    @@karatsurba4791 No, the probability matrix A doesn't change, it is the probability vector x that updates every iteration.

  • @lioneloddo
    @lioneloddo Жыл бұрын

    For Blaise Pascal, there are two kind of intelligence. People who need to see to understand and people who need to use concepts to understand. First use inductive methods and like artificial intelligence, the others use deductive methods, like to start from principles, like beautiful theories and human intelligence. I wonder if Pr Brunton is from the first or the second kind ...

  • @AnEnemyAnemone1

    @AnEnemyAnemone1

    Жыл бұрын

    An ideally intelligent person uses both “modes” of thought. In fact, I don’t think any person leans that heavily into either mode. For the most part, we all rely on both of these epistemic approaches.

  • @user-wr6cp3oz9v
    @user-wr6cp3oz9v8 ай бұрын

    So, is Cloudy a linear combination of Rainy and Nice? -sincerely, a smart ass

  • @user-vg7zv5us5r
    @user-vg7zv5us5r Жыл бұрын

    5:39 Matrices were invented to represent non-commutative system, i.e. values in each row aren't supposed to be summarized.

  • @Waferdicing
    @Waferdicing Жыл бұрын

    🙀

  • @terrym2007
    @terrym2007 Жыл бұрын

    Seattle Convergence....

  • @JYagecic
    @JYagecic Жыл бұрын

    For R users: myprobs

  • @kqb540
    @kqb540Ай бұрын

    Can someone please edit the squeaks out. I was really hoping to watch the videos. But the squeaks are jarring.

  • @zrmsraggot
    @zrmsraggot Жыл бұрын

    I have a question, is it to possible to find out what the A matrix knowing what this (50, 3) array that holds the different states ? Thanks

  • @user-eg9nc6so9x
    @user-eg9nc6so9x Жыл бұрын

    Thank you

Келесі