I want to compute and display a histogram and also plotting the mean, variance and quartiles. I have no idea how to do this. Coding isn't my strength and plotting stuff is the worst.
I calculated the probabilities, mean, var, quartiles. I also plotted the probabilities and the pdf curve, which was simple with seaborn (this helped me out a bit).
Is this actually correct so far and how do I add mean, var and quartiles to the plot?
import seaborn as sns
import numpy as np
import math
import statistics
# calculating probabilities
i = 1
probability = []
for i in range(100):
probability.append((61/99) * math.e**(-0.5 * i) + (38/99) * math.e**(-0.25 * i))
mean = sum(probability)/float(len(probability))
variance = statistics.variance(probability)
q25 = np.quantile(probability, 0.25)
q50 = np.quantile(probability, 0.5)
q75 = np.quantile(probability, 0.75)
sns.displot(probability, bins=100, kde=True);
Thanks in advance :)