mardi 31 octobre 2023

Generating Random numbers following lognormal distribution [closed]

I am generating pseudo random numbers following lognormal distribution using following python but the numbers are not validating against the data I already have. I have mean and standard deviation of the lognormal distribution (Mean=0.198, std=0.0963). Need some help on it. Thanks. Code is as following

import numpy as np

mean = float(input("Enter the mean of the log-normal distribution: "))
std_dev = float(input("Enter the standard deviation of the log-normal distribution: "))

# Generate and display 365 random numbers following the log-normal distribution
for _ in range(365):
    random_number = np.random.lognormal(mean, std_dev)
    print(random_number)



Aucun commentaire:

Enregistrer un commentaire