where X and Y are independent exponential
random variables, each with expected value 1000
Write R commands to simulate one pair of values of (X, Y ) and compute
R = X/Y . Create a loop to run the above commands 100 times. Store the
100 values of X in a vector Xsample, the 100 values of Y in a vector Ysample
and store the ratios, R, in a vector Rsample.
Draw histograms of the data in Xsample, Ysample and Rsample
이부분을 어떻게 코딩해야될지 모르겠는데 참고할만한 링크같은것도 좋고 코딩 예시도 좋으니 도와주시면 감사하겠습니다.
여기 통계하는놈도있누?
F가 exponential dist'n의 cdf라고 하고, U~unif(0,1)이라고 하면 F^{-1}(U)는 지수분포를 따름.
U는 R에서 Generating 가능하니까, F 역함수만 구하면, 지수분포도 Generating 가능
감사합니다 ㅠㅠ
그냥 지수분포 무작위추출 함수가 R에 있을거 같은데
inverse cdf method쓰려고 cdf의 역함수 구하는게 더 고행아니겠누