Question
python C-E please
C) Generate 1,000, 000 samples from the random variable X of part B. Estimate the empirical mean of X. Plot the pmf of the sa
0 0
Add a comment Improve this question Transcribed image text
Answer #1

c) The following code gives us the estimate of empirical mean (i.e. the sample mean) and the pmf of the sample:

import numpy as np import matplotlib.pyplot as plt np.random.geometric (p-0.1,size-1000000) X x.mean () mean {mean) print (fIt gives us the following output:

|mean = 10.017263

0.10 0.08 0.06 0.04 0.02 0.00 40 0 20 60 80 100 120 140

d & e) Now the code below can be used for both part d) and e) to find out the memorylessness from putting the time t=3,6 and 9:

import numpy as np import matplotlib.pyplot as plt x = np.random.geometric(p = 0.1,size 1000000) def f (t) return x[ (x >= t)

it gives us the following output:

mean of Y = 9.00305900281695

0.10 0.08 0.06 0.04 0.02 0.00 0 40 60 80 100 120 Class interval Frequency 20

for part e) also we will get the same pmf from the sample which ensures us about the memoryless property. Their mean also becomes the same as X.

Add a comment
Know the answer?
Add Answer to:
python C-E please C) Generate 1,000, 000 samples from the random variable X of part B. Estimate the empirical mean o...
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