Rejection Sampling + R Demo

Поділитися
Вставка
  • Опубліковано 24 лип 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 Рік тому +1

    This video is a masterpiece. Very well articulated.

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

    these videos are gold. thank you so much

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

    Thank you so much for you clear explanations ! Really helpful

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

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

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

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

  • @muhammadosama8308
    @muhammadosama8308 4 роки тому +6

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

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

    this is such an amazing video, subbing!

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

    This is really helpful, thank you!

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

    Wonderful video and well explained!

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

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

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

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

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

  • @paullouw6080
    @paullouw6080 4 роки тому +1

    Thank you thank you thank you!

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

  • @user-qp4ic8pj4x
    @user-qp4ic8pj4x 3 роки тому +1

    와씨 감사합니다 ㅠㅠ

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

    Many thanks !!!:)

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

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

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

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

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

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

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

    where does numbers from count

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

    THX

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

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

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

    How can we calculate the rejection ratio in this example?

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

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

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

  • @Cam-lh7nr
    @Cam-lh7nr 2 місяці тому

    How does your pdf have values greater than 1?

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