Question
Please use Python to solve this problem. Let x1, x2,x3....xn be independent random variables having a common distribution X. We can use ( s u
Please use Python to solve this problem.
Let x1, x2,x3....xn be independent random variables having a common distribution X. We can use (sum i=1 to xi )/n as an estimation for the expected value of X. Let N0=1000, and S=1000.
(a) Use np.random.pareto(alpha, n) from the Numpy library to create n instance of a Pareto distribution with parameters alpha= 2 and m=1
(b) Choose a value N1> N0+50S. Vary n from N0 to N1 by steps of size S, and estimate the expect value of the Pareto distribution for each n. Plot your estimation for each value of n.
(c) By observing the plot of part b, find (by trial and error) the value N1 for which your estimation lies within 2% of the expected value of the Pareto distribution for 50 consecutive steps before N1, ie. your estimation must lie within 2% of the expected value for n= N1-50S, N1-49S, N1-48S......,N1
(d) Repeat parts a-c for an exponential distribution with parameter lambda=2. You can use np.random.exponential (lambda,n) from the Numpy library
(e) Compare N1 derived in part c for the Pareto and exponential distributions. What is your observation?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started