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