0

For each of the following distributions, plot its pdf in the given interval and a histogram based on 1000 samples. Use pdf(x, *args)to compute the probability densities for the given array of x values, e.g.,norm.pdf(x, a, b). Use rvs(*args, n)to sample n values, e.g. norm.rvs(a, b, n).

(a) Normal distribution: N(5,1.5). Plot interval: [0,10]

my current solution:

import numpy as np 
import matplotlib.pyplot as plt 
from scipy.stats import beta, expon, gamma, laplace, norm  

x = norm.rvs(5,1.5,1000)
graph = plt.plot(x,norm.pdf(x,5,1.5))
2
  • 1
    Heyoka, you can help others help you by saying what is the problem that you have encountered. My advice is to add some text to your problem statement to say what is the error or other problem you have run into. Nov 7, 2020 at 5:08
  • there is no error but dont sure if i did what is written in the task?
    – heyoka955
    Nov 7, 2020 at 9:50

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.