Skip to content

Commit a46768c

Browse files
committed
Created using Colaboratory
1 parent 1135554 commit a46768c

File tree

1 file changed

+196
-0
lines changed

1 file changed

+196
-0
lines changed

ARIMA_&_SARIMA.ipynb

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
{
2+
"nbformat": 4,
3+
"nbformat_minor": 0,
4+
"metadata": {
5+
"colab": {
6+
"name": "ARIMA & SARIMA.ipynb",
7+
"provenance": [],
8+
"mount_file_id": "1h0-Hypu0AntwTzJgUU1aW4y0SWIsinUC",
9+
"authorship_tag": "ABX9TyMTf7bGAILd6nKrxNRhZPIC",
10+
"include_colab_link": true
11+
},
12+
"kernelspec": {
13+
"name": "python3",
14+
"display_name": "Python 3"
15+
},
16+
"language_info": {
17+
"name": "python"
18+
}
19+
},
20+
"cells": [
21+
{
22+
"cell_type": "markdown",
23+
"metadata": {
24+
"id": "view-in-github",
25+
"colab_type": "text"
26+
},
27+
"source": [
28+
"<a href=\"https://colab.research.google.com/github/noobcoder2/demo-repo/blob/main/ARIMA_%26_SARIMA.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
29+
]
30+
},
31+
{
32+
"cell_type": "markdown",
33+
"source": [
34+
"\n",
35+
"ARIMA and Seasonal ARIMA\n",
36+
"Autoregressive Integrated Moving Averages\n",
37+
"The general process for ARIMA models is the following:\n",
38+
"\n",
39+
"Visualize the Time Series Data\n",
40+
"Make the time series data stationary\n",
41+
"Plot the Correlation and AutoCorrelation Charts\n",
42+
"Construct the ARIMA Model or Seasonal ARIMA based on the data\n",
43+
"Use the model to make predictions\n",
44+
"\n",
45+
"\n"
46+
],
47+
"metadata": {
48+
"id": "CjJ4wkcghkSx"
49+
}
50+
},
51+
{
52+
"cell_type": "code",
53+
"source": [
54+
"import pandas as pd\n",
55+
"import numpy as np\n",
56+
"import seaborn as sns\n",
57+
"import matplotlib.pyplot as plt\n",
58+
"%matplotlib inline"
59+
],
60+
"metadata": {
61+
"id": "82o_BC4-XPOz"
62+
},
63+
"execution_count": null,
64+
"outputs": []
65+
},
66+
{
67+
"cell_type": "code",
68+
"execution_count": 12,
69+
"metadata": {
70+
"id": "xkPuoTAhVnNM"
71+
},
72+
"outputs": [],
73+
"source": [
74+
"CS_hs = pd.read_csv('CS_hs.csv');\n",
75+
"CS_m_all = pd.read_csv('CS_m_all.csv')\n",
76+
"CS_mor = pd.read_csv('CS_mor.csv')\n",
77+
"CS_pr = pd.read_csv('CS_pr.csv')\n",
78+
"CS_q_all = pd.read_csv('CS_q_all.csv')\n",
79+
"CS_wa = pd.read_csv('CS_wa.csv')\n",
80+
"FH_hs = pd.read_csv('FH_hs.csv')\n",
81+
"FH_m_all = pd.read_csv('FH_m_all.csv')\n",
82+
"FH_mor = pd.read_csv('FH_mor.csv')\n",
83+
"FH_pr = pd.read_csv('FH_pr.csv')\n",
84+
"FH_q_all = pd.read_csv('FH_q_all.csv')\n",
85+
"FH_wa = pd.read_csv('FH_wa.csv')\n",
86+
"ZI_m_all = pd.read_csv('Zi_m_all.csv')\n",
87+
"ZI_mor = pd.read_csv('Zi_mor.csv')\n",
88+
"ZI_pr = pd.read_csv('Zi_prfi.csv')\n",
89+
"ZI_q_all = pd.read_csv('Zi_q_all.csv')\n",
90+
"ZI_wa = pd.read_csv('Zi_Wa.csv')"
91+
]
92+
},
93+
{
94+
"cell_type": "code",
95+
"source": [
96+
"Zi_hs = pd.read_csv('Zi_hs.csv')"
97+
],
98+
"metadata": {
99+
"id": "SzAUMvQXmTM_"
100+
},
101+
"execution_count": 18,
102+
"outputs": []
103+
},
104+
{
105+
"cell_type": "code",
106+
"source": [
107+
"# Convert Month into Datetime\n",
108+
"CS_hs['Date']=pd.to_datetime(CS_hs['Date'])\n",
109+
"CS_mor['Date']=pd.to_datetime(CS_mor['Date'])\n",
110+
"CS_pr['Date']=pd.to_datetime(CS_pr['Date'])\n",
111+
"CS_wa['Date']=pd.to_datetime(CS_wa['Date'])\n",
112+
"CS_q_all['Date']=pd.to_datetime(CS_q_all['Date'])\n",
113+
"CS_m_all['Date']=pd.to_datetime(CS_m_all['Date'])\n"
114+
],
115+
"metadata": {
116+
"id": "NMrrkyvnidMA"
117+
},
118+
"execution_count": 13,
119+
"outputs": []
120+
},
121+
{
122+
"cell_type": "code",
123+
"source": [
124+
"FH_hs['Date']=pd.to_datetime(FH_hs['Date'])\n",
125+
"FH_mor['Date']=pd.to_datetime(FH_mor['Date'])\n",
126+
"FH_pr['Date']=pd.to_datetime(FH_pr['Date'])\n",
127+
"FH_wa['Date']=pd.to_datetime(FH_wa['Date'])\n",
128+
"FH_q_all['Date']=pd.to_datetime(FH_q_all['Date'])\n",
129+
"FH_m_all['Date']=pd.to_datetime(FH_m_all['Date'])"
130+
],
131+
"metadata": {
132+
"id": "_eO1HxE0jPne"
133+
},
134+
"execution_count": 14,
135+
"outputs": []
136+
},
137+
{
138+
"cell_type": "code",
139+
"source": [
140+
"ZI_hs['Date']=pd.to_datetime(ZI_hs['Date'])\n",
141+
"ZI_mor['Date']=pd.to_datetime(ZI_mor['Date'])\n",
142+
"ZI_pr['Date']=pd.to_datetime(ZI_pr['Date'])\n",
143+
"ZI_wa['Date']=pd.to_datetime(ZI_wa['Date'])\n",
144+
"ZI_q_all['Date']=pd.to_datetime(ZI_q_all['Date'])\n",
145+
"ZI_m_all['Date']=pd.to_datetime(ZI_m_all['Date'])"
146+
],
147+
"metadata": {
148+
"id": "Kl6Lb_RUje0O"
149+
},
150+
"execution_count": 20,
151+
"outputs": []
152+
},
153+
{
154+
"cell_type": "code",
155+
"source": [
156+
"df.set_index('Month',inplace=True)"
157+
],
158+
"metadata": {
159+
"id": "9fnag4Osipmc"
160+
},
161+
"execution_count": null,
162+
"outputs": []
163+
},
164+
{
165+
"cell_type": "code",
166+
"source": [
167+
"df.describe()"
168+
],
169+
"metadata": {
170+
"id": "5RMvQw9vipu0"
171+
},
172+
"execution_count": null,
173+
"outputs": []
174+
},
175+
{
176+
"cell_type": "markdown",
177+
"source": [
178+
"ARIMA TESTING"
179+
],
180+
"metadata": {
181+
"id": "y30Ph_rBmpxn"
182+
}
183+
},
184+
{
185+
"cell_type": "code",
186+
"source": [
187+
""
188+
],
189+
"metadata": {
190+
"id": "S9FanlKDmtXi"
191+
},
192+
"execution_count": null,
193+
"outputs": []
194+
}
195+
]
196+
}

0 commit comments

Comments
 (0)