Question: Using Python , the aim is to fill two vector arrays xv and yv with x and f(x) values, respectively, where the probability density function
Using Python, the aim is to fill two vector arrays xv and yv with x and f(x) values, respectively, where the probability density function for pareto is:
f(x,b) = b/xb+1
for x>1 and b>0.
Pareto takes b as a shape parameter for b. Let the xv values be uniformly spaced in xv = [1,5] with 100 grid points.
Write a loop to fill in the values for xv and yv = f(xv,b), for b=1, b=2 and b=3.
- So at the end you should have a vector xv with the X-values and a vector yv with the function values f(x,b) for any given b.
Plot yv against xv using the plot command (you should have three lines in a single figure - one for each b).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
