Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
119 views
in Artificial Intelligence (AI) by (178k points)
How do I plot the probability density function (PDF) of the Rayleigh distribution?

Please log in or register to answer this question.

1 Answer

0 votes
by (178k points)

You can plot the PDF of the Rayleigh distribution using the matplotlib library. Here's an example code:

import numpy as np
import matplotlib.pyplot as plt

# Set the scale parameter (σ)
scale_parameter = 2.0

# Generate a range of x values
x = np.linspace(0, 10, 1000)

# Calculate the PDF values
pdf = (x / scale_parameter**2) * np.exp(-x**2 / (2 * scale_parameter**2))

# Plot the PDF
plt.plot(x, pdf, label=f'Scale={scale_parameter}')
plt.xlabel('x')
plt.ylabel('PDF')
plt.title('Rayleigh Distribution PDF')
plt.legend()
plt.show()
 

This code generates a plot of the Rayleigh distribution's PDF with the specified scale parameter.

Remember to install numpy and matplotlib if you haven't already:

pip install numpy matplotlib
 

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...