Skip to content

Instantly share code, notes, and snippets.

@saimadhu-polamuri
Created October 19, 2023 12:57
Show Gist options
  • Save saimadhu-polamuri/1833bdb7e301d637fda505799e4d9de3 to your computer and use it in GitHub Desktop.
Save saimadhu-polamuri/1833bdb7e301d637fda505799e4d9de3 to your computer and use it in GitHub Desktop.
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