Metropolis - Hastings : Data Science Concepts

Поділитися
Вставка
  • Опубліковано 31 гру 2024

КОМЕНТАРІ • 224

  • @dzmitrykoniukhau1362
    @dzmitrykoniukhau1362 3 роки тому +114

    Guys, realize for a sec how cool is that we are living in the time of the Internet.
    I got a topic for my seminar (Monte Carlo samplings) where I need to elaborate the topic of Metropolis - Hastings sampling among others. So I started to read the book my prof recommended me, couldn't understand a sh*t so I am going to UA-cam, searching for the corresponding videos, finding this one and understand EVERYTHING. 30 years ago I would have to go to the library and ask there another book and spent there ages until I'll understand it. Now it is simple as that!
    Bro, thank you sooo much for the way you are explaining the stuff! Those parts with the toy examples and the intuition behind it are so helpful!
    This is not the first time you are saving my ass!!!
    From Belarus with Love!

  • @ericpenarium
    @ericpenarium 3 роки тому +95

    This is seriously next level teaching. I’ve never heard such a clear explanation of M-H before! Amazing job.

  • @michaelzumpano7318
    @michaelzumpano7318 3 роки тому +128

    This is a topic that has a lot of layers, but you did a great job of taking it apart and putting it back together! You’re a great teacher.

  • @shutonggu5478
    @shutonggu5478 Рік тому +4

    I have tried to understand what hacks the relationship between MC and posterior probability is for the whole day; but after looking at your video, just in 20 min, I understand it. The teaching is so clear and easy to understand! Very high-quality teaching!

  • @edwardmartin100
    @edwardmartin100 3 роки тому +19

    Awesome. The last five minutes on intuition is especially good

  • @MrTSkV
    @MrTSkV 3 роки тому +62

    This is an impressive alloy of math and intuition behind it - not something you get to see very often in short educational videos like this, because it's really REALLY hard to do. But you sir are one of the few exceptions. Bravo! Please never stop.
    I'm sorry for my English, just wanted to say how impressed I am. Have a good one!

    • @ritvikmath
      @ritvikmath  3 роки тому +11

      thanks for the kind words! Also, I really like how you used the word "alloy"; I'm going to start using that :)

  • @zypresse2726
    @zypresse2726 Місяць тому +2

    wow I didn't notice how 18 minutes passed by... well done! thanks so much !

  • @zmsalex232
    @zmsalex232 29 днів тому

    You are awesome. I watched from Inverse Transformation Method, Rejection Method to this Metropolis-Hasting Method. I was previously confused about those concepts taught by my university lecturer but now I fully understands them all. Thank you so much for your wonderful and insightful teaching video.

  • @vickylim3213
    @vickylim3213 Рік тому

    You did make the person who doesn’t have english as mother tongue understand the topic!! You have so much talent at teaching! Great job!

  • @jmaes678
    @jmaes678 25 днів тому

    You explain this incredibly well! I cant put into words how helpful your videos have been

  • @PhilippeZwick
    @PhilippeZwick Рік тому

    I watched a lot of videos for this topic and at around 15:51 thanks to your intution it flipped the switch in me and finally the reason behind all of this makes sense - feels good. Thank you so much!

  • @rishi71095
    @rishi71095 Рік тому +1

    The first thing I do now when I don't understand a concept is to see if you have a video on it. You make the best videos on the most complicated topics and make them so easy to understand. Simply the best! Thank you for your efforts!

    • @Yesuuh
      @Yesuuh Рік тому +1

      i agree veeray... this guy has the magic touch!

    • @rishi71095
      @rishi71095 Рік тому +1

      Haha absolutely! 😁

  • @filippobargagna
    @filippobargagna Рік тому

    Came here thinking I understood Metropolis-Hastings, enriched myself with doubts during the lecture, wrapped everything up with you at the end. I'm now leaving with a more full understanding. You are an amazing teacher!

  • @skua-se1bp
    @skua-se1bp 2 роки тому +2

    You did a fantastic job by explaining so many things within 20 minutes and with no jargon!

  • @Anzah1
    @Anzah1 3 роки тому +3

    Landed here after watching a couple of videos on M-H, and none of them were remotely as clear as your explanation! and your explanation made me really appreciate the intuitive simplicity and beauty of the math. Great work! Really wish I had a teacher like you during my bachelors :D

  • @jacoblink4380
    @jacoblink4380 Рік тому

    Mate, this is the most amazing and clear content re MCMC ive yet seen. incredible. thank you so much!

  • @JayleeWu
    @JayleeWu Рік тому +3

    Hey there! Just would like to thank you for all these wonderful high-quality work you've made and shared with us. I've seen bunch of different versions of videos covering similar topics, but yours is definitely my favorite so far! Great pace control, clear explanation and wonderful teaching style. Well done man. Please keep it up! cheers! 💪👏🙏

  • @i-fanlin568
    @i-fanlin568 2 роки тому +3

    Your explanation of the proposal density is the best I ever found! Thank you so much for your sharing!

  • @bretasopik
    @bretasopik Рік тому +1

    Amazing explanation! I usually do not comment on UA-cam but here I make an exception. Good job!

  • @gamalieliissacnyambacha3029

    You clarify complex concepts to make them easier to understand; this will significantly help me in my Advanced Workbook assignment, thanks.

  • @crazyjerry543
    @crazyjerry543 3 роки тому +3

    You definitely deserve more exposure!! Thanks a lot for these great explanations:)

  • @MegaNightdude
    @MegaNightdude 3 роки тому +1

    You're a saint. Thanks to people like you, the world has a chance.

  • @Feschmesser2
    @Feschmesser2 3 роки тому +3

    Awesome explanation, best resource i have found to really understand the intuition behind MH. Thank for your effort!

  • @letranthu5165
    @letranthu5165 3 роки тому +1

    The series of your videos is indeed amazing! Thank you so so much!

  • @leoware9319
    @leoware9319 3 роки тому +1

    This is so great. Best video I have found on this topic by far.

  • @raphaelbaur4335
    @raphaelbaur4335 3 роки тому +4

    Amazing, deserves more views and could easily replace many of the lectures on MH out there!

  • @jaytimbadia2191
    @jaytimbadia2191 2 роки тому +4

    So clearly explained. After so many years, I finally understood this. Thank you so much! It would be really great if you can explain on how we can differentiate on samplings!

  • @xinzhou4360
    @xinzhou4360 2 роки тому

    Kindly remind, there is a typo that the MAX(1, r_{f}r_{g}) should be MIN(1, r_{f}r_{g}). Many thanks, Ritvik, your video helped me a lot.

  • @איילתדמור
    @איילתדמור Рік тому

    In my statistics course they first presented the markov chain and then proved that its stationary distribution is the one we are looking for which was very confusing. What helped me a lot in this video is that you showed the derivation of the chain. Thanks for the great explanation and intuition at the end!

  • @xuxizhi6494
    @xuxizhi6494 10 місяців тому

    Very clear explaination! Specifically, I love the intuition part at the end so much. Thanks for your excellent work!

  • @pxz3900
    @pxz3900 2 роки тому

    Absolutely best math teacher on this planet. Everytime I am searching for a math concept , if there's a video by ritvikmath, I know I am saved.

  • @aarontan5748
    @aarontan5748 Рік тому

    Watched two years ago, when I was a undergrad. Now I came back watched it again and again when I am grad. Great video!

  • @bassoonatic777
    @bassoonatic777 3 роки тому

    Fantastic job. This is the best explanation and description of MH that I've ever heard.

  • @taotaotan5671
    @taotaotan5671 3 роки тому +1

    Your channel is super helpful. I finally understand MCMC and successfully programmed!

  • @paintednow
    @paintednow 2 роки тому +1

    Man, this is the best presentation of Metropolis-Hastings I have seen, yet. Respect - keep up the good work!

  • @michaelrainer7487
    @michaelrainer7487 3 роки тому

    Ritvikmath is the only person who was able to finally explain Bayes to me. By far the best explanation I have ever seen. A+

  • @MiaoQin-m2u
    @MiaoQin-m2u 3 місяці тому

    Thanks for sharing. I think I understand MH algorithm. You are so cool to explain profound theories in simple words!

  • @sxz452
    @sxz452 Рік тому

    The best explanation of Metropolis Hastings on the internet.

  • @NuclearSpinach
    @NuclearSpinach Рік тому +1

    Wrapping up a statistics PhD and I still come back to this video every few months to re-calibrate my intuition

  • @ZinzinsIA
    @ZinzinsIA Рік тому

    Very very clear summary of MH algorithm with explanation of every step. Really great and helpful work, thanks a lot !

  • @Zooooooombie
    @Zooooooombie 2 роки тому

    This succeeded for me where all other videos failed.. great explanation!

  • @itspulcio
    @itspulcio 2 роки тому +1

    Love this explenation!

  • @timlonsdale
    @timlonsdale 2 роки тому

    I'm binging your videos. God tier teaching!

  • @sararay6263
    @sararay6263 2 роки тому

    Great job Ritvik..such a cool explanation..love it!! Keep up the good work. Cheers!!

  • @proxyme3628
    @proxyme3628 2 роки тому +1

    Great video and explanation. Wish those articles and videos dumping math formulas watch this video and learn now to explain.

  • @yianqian3709
    @yianqian3709 2 роки тому

    Thank you so much!! This is the clearest explanation of MH I have ever seen.

  • @thienle4434
    @thienle4434 3 роки тому +1

    Wonderful job Ritvik. Thank you.

  • @rebeccalynch6315
    @rebeccalynch6315 3 роки тому +2

    seriously you are saving me for upcoming exams
    thank you!

  • @GamerHDNL
    @GamerHDNL 2 роки тому

    Truly increadible clarity, thank you very much!

  • @tannys
    @tannys 3 роки тому +1

    best video on MH. you make a great teacher!

  • @learn5081
    @learn5081 3 роки тому +2

    This is extremely helpful! Thank you so much!! Also I appreciate your sharing your own experience learning this!

  • @tianlongwang7238
    @tianlongwang7238 Рік тому

    hihi thanks for the video, i paused before 10:23 and working on the intuition of this, then i realize it shoud not be max of the two, and then i drag the bar and found you secretly change max to min. But the explanation is perfect and helped a lot!!!

  • @arianova5312
    @arianova5312 2 роки тому

    Great video, the intuition part is amazing. Thanks!

  • @diomerda111
    @diomerda111 2 роки тому

    man, you are so gifted as a teacher, keep up the good work :)

  • @moimonalisa5129
    @moimonalisa5129 2 роки тому

    Thank you for the video. Every math is based on intuition and you give it back when I'm about to loose mine. I paused a while and put attention on the max, then I was surprised when it suddenly changed to min. LOL..

  • @fengjeremy7878
    @fengjeremy7878 2 роки тому

    The explanation of ituition is great!

  • @rikki146
    @rikki146 Рік тому

    Your explanation is next level. Thank you very much!

  • @elenapatsalou9229
    @elenapatsalou9229 2 роки тому

    You are great!!! keep going, finally, I understood the metropolis hastings algorithm idea xD

  • @matthewkumar7756
    @matthewkumar7756 3 роки тому +2

    This is the best explanation I've came across this. I've been trying to build the intuition outside of the math.
    In implementing this, say through a computer simulation, I frequently see that if the acceptance probability is between 0 and 1, it's compared to a random draw of the uniform distribution. I'm missing a link in the intuition/math about this component specifically. Can you elaborate a bit more? I kind of get it, but kind of don't.
    Looking forward to checking out the rest of your videos!

    • @ritvikmath
      @ritvikmath  3 роки тому +2

      that's actually a tricky concept to grasp; it took me some time too.
      Pretend the acceptance probability is 0.1. That means we want to accept this event 10% of the time and reject it 90% of the time. Now suppose we generate some uniform random number u between 0 and 1. Consider the two cases:
      1) u < 0.1 : this happens with probability exactly 10% (since it came from a uniform random distribution)
      2) u >= 0.1 : this happens with probability exactly 90% (since it came from a uniform random distribution)
      So we can exactly use the value of u to decide whether to accept or reject.

    • @matthewkumar7756
      @matthewkumar7756 3 роки тому

      @@ritvikmath What you describe above makes that step in the implementation so much more clear!
      Thanks for circling back to this (and so quickly), I really appreciate it.

    • @pradyumnadas6265
      @pradyumnadas6265 3 роки тому

      @@ritvikmath Why not sample from a binomial distribution with p = 0.1?

  • @moeinpoi
    @moeinpoi 2 роки тому

    Wish there was a triple-like button. Perfect explanation. Thanks a lot!

  • @stefanocarini8117
    @stefanocarini8117 9 місяців тому +1

    Crystal clear! Thank you! :)

    • @ritvikmath
      @ritvikmath  9 місяців тому

      Glad it was helpful!

  • @IreneGao-n9i
    @IreneGao-n9i Рік тому

    Thanks for your explanations!! Very useful and clear to help the understanding!!

  • @leieiei14
    @leieiei14 3 роки тому

    I found this video very helpful after I got confused in my course. Thank you very much!

  • @AnganMitra007
    @AnganMitra007 2 роки тому

    Great presentation and thanks for the intuition!

  • @alexmonfis9305
    @alexmonfis9305 2 роки тому

    I'm doing a master on data science and you are saving me on bayesian stats! Thanks

  • @Ed-P-123
    @Ed-P-123 2 місяці тому +1

    this whole thing basically collapses to a moving mean distribution

  • @cynthpielin7334
    @cynthpielin7334 3 роки тому

    Thank you! Really amazing lesson. I really appreciate the intuition part at the end!

  • @CossZt6
    @CossZt6 9 місяців тому

    A question about the unnormalized distribution f(x): In a practical situation can f(x) consist of empirical data, for example, formulated as a histogram of occurrences of some quantity?

  • @ginnyli2913
    @ginnyli2913 3 роки тому +2

    Noticed your change from MAX to MIN at around 10:23. HAHAHAH, great move!

  • @proxyme3628
    @proxyme3628 2 роки тому

    At 10:20, A(a->b) = MAX(1, rfrg) is flipped to A(a->b) = MIN(1, rfrg), but still A(a->b) is MAX(1, f(b)/f(a)). Why? Should have been MIN(1, f(b)/f(a)) because going down should happen with the chance of f(b) / f(a) when f(b) < f(a)? Otherwise MAX(1, f(b)/f(a)) gives always TRUE and only climb happen. It would work for single mode but how about multi mode? To be able to handle multi mode, we should also go down, not just climb to find the global optima?

  • @juanvillegas5580
    @juanvillegas5580 2 роки тому

    Wow this was such a nice explanation, kudos!

  • @claudiodicarlo2094
    @claudiodicarlo2094 2 роки тому

    insane quality video

  • @kathyker3498
    @kathyker3498 2 місяці тому +1

    very well done... thank u!

  • @dannyzilberg3101
    @dannyzilberg3101 2 роки тому

    How do we know that the chain will collaplse to this steady state? Shouldn't we check that the eigen values of the transition are all negative or something similar? Or is that guarenteed by the dominant balance?
    Great video by the way, thank you very much!

  • @jackcashman1190
    @jackcashman1190 8 місяців тому

    Incredible explanation.

  • @RAP4EVERMRC96
    @RAP4EVERMRC96 2 роки тому

    Honestly I have a hard time thinking of those continuous markov chains. In the past videos we had discrete markov chains with stochastic matrices describing the transition probabilities of going from one state to the other. Here we have a continuous distribution giving us endless transition probabilities. I just don't get how a markov chain is behind all of this. So if I am not incorrect in the MCMC case we yet don't have a Transition probability (matrix), because such would be given by p(x) - as it follows the condition that either rows or columns must add up to one, which is equivalent to having a NC in the continuous case. So our goal is to come up with a steady state distribution that samples from a p(x). In other words we find a pi for a transition matrix which we don't know? Is there maybe a good explanation for a discrete case? I don't get what we already know about the transition matrix, because obviously we do know something - here f(x). But what is that f(x) in a discrete sense? I would highly appreciate an answer.

  • @noncsan
    @noncsan 5 місяців тому

    Hi, very amazing explanation! Do you have an intuition behind how the Hastings factor (rg in your video) works in case of the proposal distribution is asymmetric?

  • @pavanpatel5050
    @pavanpatel5050 2 роки тому

    Amazing explanation! MH was magic to me until I watched this! Thank you 🙏

  • @javadvahedi6278
    @javadvahedi6278 2 роки тому +1

    First of all many thanks for the nice and useful content and teaching approach. Secondly, could you introduce any textbook related your video series on Montecarlo calro, Markov chain,..., thanks in advance

  • @Opera-1553
    @Opera-1553 2 роки тому +1

    Look where you are currently at, look where you have been proposed to go. If the place where you have been proposed to go is of higher probability then you better go there. 👏👏❣

  • @dz7967
    @dz7967 Рік тому

    Nice video! One question: would we risk getting stuck at one of the higher-density areas when there are several peaks in p(x)

  • @fsaldan1
    @fsaldan1 Рік тому

    Could you do a video on the NUTS sampler and Hamiltonian samplers in general? Supposedly they are state-of-the-art and superior to Metropolis-Hastings.

  • @DanyCywiak
    @DanyCywiak 8 місяців тому

    Amazing and super helpful video! 👏🏻👏🏻

    • @ritvikmath
      @ritvikmath  8 місяців тому

      Glad it was helpful!

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 3 роки тому

    This explanation is golden. Can you do a coding example to solidify understanding, as future video suggestion.

  • @santidu
    @santidu 3 місяці тому

    I got the impression that alpha satisfies the detailed balance condition. And since detailed balance implies x is from the true distribution, our first sample should already come from the true distribution. So no need to discard the first few samples. What am I thinking wrong?

  • @hannahnelson4569
    @hannahnelson4569 5 місяців тому

    I learned something! Very good video!

  • @10Exahertz
    @10Exahertz 3 роки тому

    at 17:19 how it this "might accept the move" performed in practice, awesome video btw

  • @yukachuenkarenyu2862
    @yukachuenkarenyu2862 Рік тому

    Thank you so so much that I finally understand metropolis hasting.🎉

  • @isaacadjetey9618
    @isaacadjetey9618 Рік тому

    Yes , I was wondering why you had max instead of min at start. But you made the correction. Thanks

  • @养兔大户
    @养兔大户 Рік тому

    hi, I have a question, why the transform is balanced for p(x) do make the MC chain lead to that stationary distribution?

  • @pan19682
    @pan19682 2 роки тому

    it is a very amazing lecture. you are really a very good gifted teacher. pls make more videos go on educating us

  • @duynguyen4154
    @duynguyen4154 3 роки тому

    Wow, it's clear the best tutorial for me. Thanks

  • @liorbenharosh
    @liorbenharosh 3 роки тому +1

    hey man I love watching your videos I learn a lot from each one of them. I have noticed that I'm more likely to watch the video if the thumbnail contains you. Black background is probably not good as well. Just wanted to share it with you, maybe you should change the thumbnail format. The format of the videos themselves is really nice in my opinion, no need for change there.

    • @ritvikmath
      @ritvikmath  3 роки тому

      thank you for the feedback! I've been experimenting with different styles and direct feedback like this means so much!

  • @nz1229
    @nz1229 3 роки тому +1

    Really effective presentation! I wonder how does the MHMCMC handle a bimodal distribution? Would it fail to measure next peak if the jumping parameter is too small?

    • @jimlim9224
      @jimlim9224 2 роки тому

      That is precisely what I was wondering. Will it get stuck in a local maximum density and only uncover a portion of the density distribuiton?

  • @fakhriddintojiboev7252
    @fakhriddintojiboev7252 3 роки тому

    Thanks for the video! I have a question. From the graph, it's visible when function f(x) gets its higher value. Why do we have to draw samples? Why can't we say immediately at these points f(x) gets the high values? Thanks for your attention!

  • @duonaquan
    @duonaquan 2 роки тому

    I love your videos! thank you so much! One question: are the NCs for f(a) and f(b) the same values? I noticed that you canceled NC out.

  • @HetirasDzn
    @HetirasDzn 3 роки тому

    Thank you for the intuitive explanation.

  • @tianjoshua4079
    @tianjoshua4079 3 роки тому

    It is my understanding MCMC works, namely asymptotically converges to p(x), ultimately based on ergodic theorem. Correct me if I am wrong, please. And could you please make some videos on ergodic theory? I find it fascinating to think about. It might be right up your alley.

  • @andreaskrmmerbagge8831
    @andreaskrmmerbagge8831 7 місяців тому

    Super well explained!

  • @haresh5_5
    @haresh5_5 8 місяців тому

    simply amazing