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 ADDED
@@ -0,0 +1,3 @@
1
+ CODE = 'fit_arima = ARIMA(stationary_series, order=(1, 0, 1)).fit()\nprint(fit_arima.summary())\nforecast = fit_arima.forecast(steps=5)\nprint(forecast)'
2
+ print('# ARIMA fitting and forecasting')
3
+ print(CODE)
eighth.py ADDED
@@ -0,0 +1,3 @@
1
+ CODE = 'forecast_add = fit_add.forecast(12)\nforecast_mul = fit_mul.forecast(12)'
2
+ print('# Q8 Forecast 12 periods')
3
+ print(CODE)
eleventh.py ADDED
@@ -0,0 +1,3 @@
1
+ CODE = 'fig, axes = plt.subplots(2, 1, figsize=(10, 7))\nplot_acf(returns, lags=30, ax=axes[0])\nplot_acf(returns**2, lags=30, ax=axes[1])\nplt.tight_layout()\nplt.show()'
2
+ print('# Q11 Volatility diagnostics')
3
+ print(CODE)
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
@@ -0,0 +1,3 @@
1
+ CODE = 'rolling = daily.rolling(window=7).mean()'
2
+ print('# Q4 Rolling mean')
3
+ print(CODE)
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
@@ -0,0 +1,3 @@
1
+ CODE = 'rmse_mul = np.sqrt(np.mean((y_monthly - fit_mul.fittedvalues)**2))\nprint("RMSE:", rmse_mul)'
2
+ print('# Q9 In-sample RMSE')
3
+ print(CODE)
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
@@ -0,0 +1,3 @@
1
+ CODE = 'fig, axes = plt.subplots(2, 1, figsize=(10, 7))\nplot_acf(x, lags=30, ax=axes[0])\nplot_pacf(x, lags=30, ax=axes[1], method="ywm")\nplt.tight_layout()\nplt.show()'
2
+ print('# Q6 ACF and PACF')
3
+ print(CODE)
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,3 @@
1
+ CODE = 't = np.arange(len(daily))\ny = daily.to_numpy()\nslope, intercept = np.polyfit(t, y, 1)\ntrend = intercept + slope * t'
2
+ print('# Q3 Linear trend')
3
+ print(CODE)
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: web-install-tsa-lab
3
+ Version: 0.3.0
4
+ Summary: Import first..eleventh to print time-series lab code snippets
5
+ Requires-Python: >=3.8
@@ -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,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,13 @@
1
+ arima
2
+ eighth
3
+ eleventh
4
+ fifth
5
+ first
6
+ fourth
7
+ imports
8
+ ninth
9
+ second
10
+ seventh
11
+ sixth
12
+ tenth
13
+ third