Rejection Sampling + R Demo

Поделиться
HTML-код
  • Опубликовано: 25 июл 2024
  • Review of rejection sampling (a.k.a. accept-reject method) plus an example in R.
    Thanks for watching!! ❤️
    R code for example:
    rpubs.com/mathetal/rejectsamp...
    //Chapters
    0:00 Rejection sampling explanation
    4:14 Example
    8:32 R demo
    Tip Jar 👉🏻👈🏻
    ☕️ ko-fi.com/mathetal
    ♫ Eric Skiff - Chibi Ninja
    freemusicarchive.org/music/Eri...
    #RejectionSampling #AcceptRejectMethod

Комментарии • 39

  • @richardy7888
    @richardy7888 2 года назад +12

    2 seconds in and already a better experience in terms of delivery and articulation compared to my current lecturer. Please continue to teach the wonders of statistics on youtube for the world's benefit.

  • @nhlanhlamsongelwa4364
    @nhlanhlamsongelwa4364 3 года назад +5

    this is such a succinct video, broke down the method and explained how to apply it in such a helpful manner. Thank you.

  • @alexiaberenicetorrescalder5742
    @alexiaberenicetorrescalder5742 3 года назад +2

    So helpful!!! Thank you! You saved my midterm

  • @rondotmarie4353
    @rondotmarie4353 2 года назад +1

    Thank you so much for you clear explanations ! Really helpful

  • @err3088
    @err3088 2 года назад +1

    these videos are gold. thank you so much

  • @abhinandanmohanty3833
    @abhinandanmohanty3833 Год назад +1

    This video is a masterpiece. Very well articulated.

  • @bayubetaB
    @bayubetaB 4 года назад +2

    This is really helpful, thank you!

  • @sirkelvinmalunga
    @sirkelvinmalunga 9 месяцев назад +1

    This video is an act of kindness to me. Thanks for sharing
    : )

  • @hongquanli1754
    @hongquanli1754 2 года назад +1

    Wonderful video and well explained!

  • @salmanfariss
    @salmanfariss 2 года назад +1

    this is such an amazing video, subbing!

  • @huilapman
    @huilapman 3 года назад +1

    Thank you so much. Your video is really really helpful.

  • @muhammadosama8308
    @muhammadosama8308 4 года назад +6

    I find your video really helpful and easy to understand thank you very much !.

  • @hongkyulee9724
    @hongkyulee9724 Год назад +2

    I am a python user, so not able to code R. However, this video is so very intuitive! Thank you for the nice lecture! Especially examples are so good!

  • @khwajashamsuddoha2055
    @khwajashamsuddoha2055 3 года назад +1

    thanks for describe the theorem in the easiest way to understand. Best of Luck. the boss

  • @paullouw6080
    @paullouw6080 4 года назад +1

    Thank you thank you thank you!

  • @jetlime08
    @jetlime08 3 года назад +1

    Many thanks !!!:)

  • @user-qp4ic8pj4x
    @user-qp4ic8pj4x 3 года назад +1

    와씨 감사합니다 ㅠㅠ

  • @PandemicGameplay
    @PandemicGameplay 3 года назад +1

    This was an extremely good video

  • @homataha5626
    @homataha5626 2 года назад +2

    in the R code when you add the value of count by one, if the candidate got accepted you increase the value of count by 1 and then you increase it again! since U add count by 1 outside of the if statement I think u should delete adding 1 to it inside if condition.

  • @sahilmohammad4336
    @sahilmohammad4336 Год назад +1

    Thanks a lot for the video. Very precise and easy to understand. However, for choosing the value of scaling factor, its not always correct to choose the end value of support. I think its better to find out the local maxima. For example, taking the end value of support in a bell-curve would not be correct because we need to scale it to at least above the maxima of target function.

  • @gsp_ram
    @gsp_ram Год назад +1

    Great

  • @fntldks
    @fntldks 3 года назад +2

    you explained the concept behind the algorithm very clearly, it makes me easy to understand the whole thing, support! one thing I want to know is what is the usage in the reality? just curious

    • @jpfarina
      @jpfarina 9 месяцев назад

      Simulating distributions. It's commonly used in software that models business processes. Not modeling them like Visio, though. Modeling them like, "how long does the average customer wait in line?" and, "what would happen if we added an additional cashier?".

  • @ccuuttww
    @ccuuttww Год назад +1

    THX

  • @soumialahfair3171
    @soumialahfair3171 2 года назад

    thank you , can you please tell me how can we do it in MATLAB

  • @charanshah3787
    @charanshah3787 Год назад

    Very helpful vedios, but can you help me how to draw using this method from normal, exponential or any proposed distribution

  • @vayvon21
    @vayvon21 Год назад

    How can we calculate the rejection ratio in this example?

  • @creepomusik2883
    @creepomusik2883 2 года назад +2

    Thank you for your vid. I think i found a little mistake in your R-Code. Your counter will increased by two if your if-statement is true, which is, as far as i understood the method correctly, not what you wanted to archive.

  • @ibahimabdullahi3613
    @ibahimabdullahi3613 3 года назад

    am working on generated distribution, i want to simulate my true parameter using MLE pls help

  • @patriciakou2171
    @patriciakou2171 2 года назад

    where does numbers from count

  • @Cam-lh7nr
    @Cam-lh7nr 2 месяца назад

    How does your pdf have values greater than 1?

  • @321MrMateus
    @321MrMateus 4 года назад +1

    Just one doubt. Generally we do not have the p.d.f, we just have some proportional density function. Therefore we just define a the eveloping cg(x) to be higher enough?

    • @mathetal
      @mathetal  4 года назад +1

      Yes, you can replace the target distribution pi(x) with a proportional distribution l(x) and the rest of the algorithm is the same

  • @ZiluZheng
    @ZiluZheng 2 года назад +1

    Why do we need the second step u~Unif? In the third step, can we set the if condition as 1< Pi(Xi)/Cg(Xi) ?

    • @mathetal
      @mathetal  2 года назад

      Xi comes from a distribution that is hard to sample directly, which means that Monte Carlo methods can be used to approximate it

  • @jorge_pb8482
    @jorge_pb8482 3 года назад +1

    te amoooo :), pero creo q te falta un else

  • @jimmyodiazportillo6978
    @jimmyodiazportillo6978 2 года назад

    Pero lo que estás almacenando son las X, no los valores de pi(X) con ese algoritmo. Y las X son uniformes, no realizaciones de la función pi. Corrijanme si me equivoco.

  • @maximegrossman2146
    @maximegrossman2146 3 года назад +3

    amazing, but the R code is a little hard to read as it's a bit blurry. nevertheless, thanks so much