web-install-tsa-lab 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arima.py +3 -0
- eighth.py +3 -0
- eleventh.py +3 -0
- fifth.py +3 -0
- first.py +3 -0
- fourth.py +3 -0
- imports.py +3 -0
- ninth.py +3 -0
- second.py +3 -0
- seventh.py +3 -0
- sixth.py +3 -0
- tenth.py +3 -0
- third.py +3 -0
- web_install_tsa_lab-0.3.0.dist-info/METADATA +5 -0
- web_install_tsa_lab-0.3.0.dist-info/RECORD +17 -0
- web_install_tsa_lab-0.3.0.dist-info/WHEEL +5 -0
- web_install_tsa_lab-0.3.0.dist-info/top_level.txt +13 -0
arima.py
ADDED
eighth.py
ADDED
eleventh.py
ADDED
fifth.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
CODE = 'adf_result = adfuller(x)\nprint("ADF statistic:", adf_result[0])\nprint("p-value:", adf_result[1])\nif adf_result[1] < 0.05:\n print("At 5%, reject the unit-root null (Stationary)")\nelse:\n print("At 5%, do not reject the unit-root null (Non-stationary)")'
|
|
2
|
+
print('# Q5 ADF test')
|
|
3
|
+
print(CODE)
|
first.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
CODE = 'rng = np.random.default_rng(42)\ndates = pd.date_range("2025-01-01", periods=100, freq="D")\nvalues = 100 + np.linspace(0, 15, 100) + rng.normal(0, 5, 100)\ndaily = pd.Series(values, index=dates, name="Value")\n\nprint(daily.head())\ndaily.plot(title="Illustrative daily time series")\nplt.xlabel("Date")\nplt.ylabel("Value")\nplt.grid(True, alpha=0.3)\nplt.show()\n\nmonthly = daily.resample("MS").mean() # Replace .mean() with .sum() as needed\nprint(monthly)'
|
|
2
|
+
print('# Q1 Daily series + monthly resample')
|
|
3
|
+
print(CODE)
|
fourth.py
ADDED
imports.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
CODE = 'import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport statsmodels.api as sm\n\nfrom statsmodels.tsa.holtwinters import ExponentialSmoothing\nfrom statsmodels.tsa.stattools import adfuller\nfrom statsmodels.graphics.tsaplots import plot_acf, plot_pacf\nfrom statsmodels.tsa.arima.model import ARIMA\n\nnp.random.seed(42)\nplt.rcParams["figure.figsize"] = (10, 4)'
|
|
2
|
+
print('# Imports')
|
|
3
|
+
print(CODE)
|
ninth.py
ADDED
second.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
CODE = 'df = pd.DataFrame({\n "Date": ["2025-01-01", "2025-01-02", "2025-01-03",\n "2025-01-02", "2025-01-03", "2025-01-04"],\n "Sales": [120, 150, 180, 170, 160, 200]\n})\ndf["Date"] = pd.to_datetime(df["Date"])\n\nprint("Duplicate date rows:", df["Date"].duplicated().sum())\nconsolidated = df.groupby("Date")["Sales"].mean().sort_index()\nprint(consolidated)'
|
|
2
|
+
print('# Q2 Duplicate dates')
|
|
3
|
+
print(CODE)
|
seventh.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
CODE = '# Additive Model\nfit_add = ExponentialSmoothing(\n y_monthly, trend="add", seasonal="add", seasonal_periods=12,\n initialization_method="estimated"\n).fit()\n\n# Multiplicative Model\nfit_mul = ExponentialSmoothing(\n y_monthly, trend="add", seasonal="mul", seasonal_periods=12,\n initialization_method="estimated"\n).fit()'
|
|
2
|
+
print('# Q7 Holt-Winters additive and multiplicative')
|
|
3
|
+
print(CODE)
|
sixth.py
ADDED
tenth.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
CODE = 'candidate_orders = [(1, 0, 0), (2, 0, 0), (1, 0, 1)]\ncomparison = []\nfor order in candidate_orders:\n fit = ARIMA(stationary_series, order=order).fit()\n n = fit.nobs\n k = len(fit.params)\n aic = fit.aic\n aicc = aic + (2*k*(k+1))/(n-k-1) if n > k+1 else np.nan\n comparison.append({"order": order, "AICc": aicc})\n\ncomparison_df = pd.DataFrame(comparison).sort_values("AICc")\nprint(comparison_df)'
|
|
2
|
+
print('# Q10 AICc model selection')
|
|
3
|
+
print(CODE)
|
third.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
arima.py,sha256=7lfHEHL-6jYSsbyDstDMDbGeraS4xxOz6EgoNvZ_0WE,207
|
|
2
|
+
eighth.py,sha256=XQfedr6JX1UqB3qu1QdU7brUxaecHGg-J_3f7zalLaI,128
|
|
3
|
+
eleventh.py,sha256=lo_8BiHI2RSEAFSN2wP_NaPE5i4NHaH9sKIZv8bxSUA,222
|
|
4
|
+
fifth.py,sha256=WYObajOcHTTEJS9IqCfIkAom_WItjio297rJAp46BoI,307
|
|
5
|
+
first.py,sha256=W-VmlPRBvJ2zh67-vp7XOnIi7LkZhpESwPfFk_y4MbQ,530
|
|
6
|
+
fourth.py,sha256=fFjmp6cPhE9p1gAUmqGqvADcd7istdUwe6sgmR6sTq0,89
|
|
7
|
+
imports.py,sha256=C4emn479f-zMC8Qva9UioI1UfcDHeiZCqZPpuf7xwEQ,429
|
|
8
|
+
ninth.py,sha256=-CLdbJbRsj5k5XOxafBW5Wd6cEK-izcEIURCYHKGJcs,143
|
|
9
|
+
second.py,sha256=9XbeebmT61hFKtQqS3MtrB-GifPushmyLD6D9JayqRY,423
|
|
10
|
+
seventh.py,sha256=cXgdhZvnouDVtbclG9UI6Z0VxKEZiZWWjqq61BzOT5s,413
|
|
11
|
+
sixth.py,sha256=vM2QDJ0JWeJD4fSVHAIhhSLkHBtmHB7SymHsQAhWHrA,211
|
|
12
|
+
tenth.py,sha256=EDkF2l9RTHAvFTHs5s2Kea9__aVL9ehjwRhf-jomo2A,478
|
|
13
|
+
third.py,sha256=EUa-4nDPVJ6OBP6X92w4Jtas5dSUoqBv-EO8R4fF6PQ,167
|
|
14
|
+
web_install_tsa_lab-0.3.0.dist-info/METADATA,sha256=QwPB9OYDeuoybjPK6Y_zdjM_ruxtWMNTyEb4g1E-9ZQ,162
|
|
15
|
+
web_install_tsa_lab-0.3.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
16
|
+
web_install_tsa_lab-0.3.0.dist-info/top_level.txt,sha256=hrcij8uk8-eSJIvVfO3gcmdwC-SYhluXG14gP5SEP_4,88
|
|
17
|
+
web_install_tsa_lab-0.3.0.dist-info/RECORD,,
|