Fix random seeds for reproducibility
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Sat, 5 Oct 2024 10:43:25 +0000 (11:43 +0100)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sat, 5 Oct 2024 10:43:25 +0000 (11:43 +0100)
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

Gbp-Pq: Name fix_random_seeds.patch

docs/source/emplike.rst
examples/notebooks/copula.ipynb
examples/notebooks/ets.ipynb
examples/notebooks/exponential_smoothing.ipynb
examples/notebooks/gee_score_test_simulation.ipynb
examples/notebooks/plots_boxplots.ipynb
examples/notebooks/predict.ipynb
examples/notebooks/robust_models_0.ipynb

index 466ad724792a6d2311380f51bf86e59b08fcdeae..267aaa07ec9715a07c65ac1aded551f286cd7e20 100644 (file)
@@ -43,6 +43,7 @@ Examples
 
   import numpy as np
   import statsmodels.api as sm
+  np.random.seed(50)  # for reproducibility
 
   # Generate Data
   x = np.random.standard_normal(50)
index 541e759696b4b8706ac6ab332cef122f45088d79..ca2f5ff0de1a39fdc32bd03ee26e32c5f53d65aa 100644 (file)
@@ -19,7 +19,8 @@
     "from scipy import stats\n",
     "\n",
     "sns.set_style(\"darkgrid\")\n",
-    "sns.mpl.rc(\"figure\", figsize=(8, 8))"
+    "sns.mpl.rc(\"figure\", figsize=(8, 8))\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
index 8b5b1f082cfb042e69dd590565aeb2e63cf1d0a6..5e2dbd4df72b6cc5376903e0de377273956e2092 100644 (file)
@@ -31,7 +31,8 @@
     "import pandas as pd\n",
     "\n",
     "%matplotlib inline\n",
-    "from statsmodels.tsa.exponential_smoothing.ets import ETSModel"
+    "from statsmodels.tsa.exponential_smoothing.ets import ETSModel\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
index e0ca8025038dd4eb680abfc436b63b63fb5752bf..ae535d1327f9bc11f4425885b305bca15b5a869f 100644 (file)
@@ -37,6 +37,7 @@
     "import pandas as pd\n",
     "import matplotlib.pyplot as plt\n",
     "from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt\n",
+    "np.random.seed(1234) # for reproducibility\n",
     "\n",
     "%matplotlib inline\n",
     "\n",
index ade0dc9a84816580d0d30d0f1cbb4da570f7e2c1..f1304d3623de819fd8dc99057374f24299569e1d 100644 (file)
@@ -23,7 +23,8 @@
     "import numpy as np\n",
     "from scipy.stats.distributions import norm, poisson\n",
     "import statsmodels.api as sm\n",
-    "import matplotlib.pyplot as plt"
+    "import matplotlib.pyplot as plt\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
index f551b0b97a1c8e7aa63336a756de7970f2d90442..92ef1390e711fb0c889c5f951943aa36748560ed 100644 (file)
@@ -24,7 +24,8 @@
     "\n",
     "import numpy as np\n",
     "import matplotlib.pyplot as plt\n",
-    "import statsmodels.api as sm"
+    "import statsmodels.api as sm\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
index 531a465a4fd24533d409a4340bafca2211cbf74e..a7e8731aa3f4622639a694179640061c21c27820 100644 (file)
@@ -28,7 +28,8 @@
     "import statsmodels.api as sm\n",
     "\n",
     "plt.rc(\"figure\", figsize=(16, 8))\n",
-    "plt.rc(\"font\", size=14)"
+    "plt.rc(\"font\", size=14)\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
index 1d1ba022172d9ff878106efb05692e70eed41f13..c22c6c015ca2eca58e6839dd016953095024ace9 100644 (file)
@@ -24,7 +24,8 @@
    "source": [
     "import matplotlib.pyplot as plt\n",
     "import numpy as np\n",
-    "import statsmodels.api as sm"
+    "import statsmodels.api as sm\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {