Rejection Sampling + R Demo

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 มิ.ย. 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.

  • @abhinandanmohanty3833
    @abhinandanmohanty3833 11 หลายเดือนก่อน +1

    This video is a masterpiece. Very well articulated.

  • @sirkelvinmalunga
    @sirkelvinmalunga 8 หลายเดือนก่อน +1

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

  • @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

  • @muhammadosama8308
    @muhammadosama8308 4 ปีที่แล้ว +6

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

    • @mathetal
      @mathetal  4 ปีที่แล้ว

      thank u :)

  • @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!

  • @bayubetaB
    @bayubetaB 4 ปีที่แล้ว +2

    This is really helpful, thank you!

  • @huilapman
    @huilapman 3 ปีที่แล้ว +1

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

  • @hongquanli1754
    @hongquanli1754 2 ปีที่แล้ว +1

    Wonderful video and well explained!

  • @salmanfariss
    @salmanfariss 2 ปีที่แล้ว +1

    this is such an amazing video, subbing!

  • @khwajashamsuddoha2055
    @khwajashamsuddoha2055 2 ปีที่แล้ว +1

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

  • @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.

  • @paullouw6080
    @paullouw6080 4 ปีที่แล้ว +1

    Thank you thank you thank you!

  • @PandemicGameplay
    @PandemicGameplay 3 ปีที่แล้ว +1

    This was an extremely good video

  • @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.

  • @jetlime08
    @jetlime08 3 ปีที่แล้ว +1

    Many thanks !!!:)

  • @user-qp4ic8pj4x
    @user-qp4ic8pj4x 3 ปีที่แล้ว +1

    와씨 감사합니다 ㅠㅠ

  • @gsp_ram
    @gsp_ram 11 หลายเดือนก่อน +1

    Great

  • @ccuuttww
    @ccuuttww ปีที่แล้ว +1

    THX

  • @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 7 หลายเดือนก่อน

      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?".

  • @vayvon21
    @vayvon21 ปีที่แล้ว

    How can we calculate the rejection ratio in this example?

  • @soumialahfair3171
    @soumialahfair3171 2 ปีที่แล้ว

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

  • @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.

  • @patriciakou2171
    @patriciakou2171 2 ปีที่แล้ว

    where does numbers from count

  • @charanshah3787
    @charanshah3787 ปีที่แล้ว

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

  • @Cam-lh7nr
    @Cam-lh7nr หลายเดือนก่อน

    How does your pdf have values greater than 1?

  • @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

  • @ibahimabdullahi3613
    @ibahimabdullahi3613 3 ปีที่แล้ว

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

  • @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

  • @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.

  • @jorge_pb8482
    @jorge_pb8482 2 ปีที่แล้ว +1

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

  • @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