Question

Develop a generator for a random variable whose pdf is F(x) ={ 1/3, 0<=x<=2 1/24, 2<x<=10...

Develop a generator for a random variable whose pdf is
F(x) ={ 1/3, 0<=x<=2
1/24, 2<x<=10
0, otherwise
a) Write a computer routine to generate 1000 values.
b) Plot a histogram of 1000 generated values.
c) Perform goodness-of-fit test to determine whether these generated values fits the theoretical density function given above.
Note: Invlude your computer routine for generating random variates in your answer sheet.

I need numerical solution

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A. gen_obs <- function(){ u1 runif(1) if(u1 <= 2/3){ 2*runif(1) return(u) u = } else{ u = 2 + 8*runif(1) return(u) } نها obs repB.Histogram of obs 009 500 400 Frequency 300 200 100 0 0 4 9 oo 10 N obsC.ChiSquare goodness of fit test -- We divided into 5 bins and null probabilities are obtained by integrating within the interv

Add a comment
Know the answer?
Add Answer to:
Develop a generator for a random variable whose pdf is F(x) ={ 1/3, 0<=x<=2 1/24, 2<x<=10...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT