Created
October 19, 2023 12:57
-
-
Save saimadhu-polamuri/1833bdb7e301d637fda505799e4d9de3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import jarque_bera | |
import numpy as np | |
# generate a sample dataset | |
data = np.random.normal(0, 1, 1000) | |
# calculate the test statistic and p-value | |
jb_stat, jb_p = jarque_bera(data) | |
# print the results | |
print("Jarque-Bera statistic:", jb_stat) | |
print("p-value:", jb_p) | |
# interpret the results | |
if jb_p < 0.05: | |
print("The dataset is not normally distributed.") | |
else: | |
print("The dataset is normally distributed.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment