lundi 25 octobre 2021

How to generate random values from a distribution with known density function in R?

I am given Zi's (i = 1,2...) form a sequence of i.i.d variables with density function:

fZ(z) = P(S1 > z)/E(S1)

Given that I know S1 follows a Pareto(1.7,70) distribution and E(S1) is equal to 100, how would i use R to obtain/generate random values of Z? Like we all know how to generate random values of a normal distribution by using rnorm(), but what if our density was custom such as above? How would I simulate values that fit that distribution?

Thank you




Aucun commentaire:

Enregistrer un commentaire