Skip to content

Commit b742479

Browse files
committed
update sarima post
1 parent 43843d4 commit b742479

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

content/posts/finance/stock_prediction/SARIMA/index.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ hero: images/sarima_example_9_1.png
1212
tags: ["Finance", "Statistics", "Forecasting"]
1313
categories: ["Finance"]
1414
---
15+
1516
## Introduction
1617

1718
The Seasonal Autoregressive Integrated Moving Average (SARIMA) model is an extension of the ARIMA model (discussed in the [previous article](/posts/finance/stock_prediction/arima/)) that incorporates seasonality. This makes it particularly useful for analyzing financial time series data, which often exhibits both trend and seasonal patterns. In this article, we'll apply the SARIMA model to Apple (AAPL) stock data, perform signal decomposition, and provide a detailed mathematical explanation of the model.
@@ -303,14 +304,16 @@ plt.show()
303304

304305
![png](images/sarima_example_9_1.png)
305306

306-
As the prei
307+
As the previous plot shows, SARIMA model takes into account stagionality with respect to the [ARIMA model]((/posts/finance/stock_prediction/arima/)) and provides better accuracy and *mape* score (5% vs. 7%). Moreover, the stagionality can deal with temporary detachment from the mean value.
308+
Nonetheless, SARIMA model is slower to train and to interfer (respectively $\approx 100%$ and $50%$ more). It still does not involve exogenous variables (possible with SARIMAX) and potential outbreaks (like Covid-19 or holidays).
309+
310+
307311

308312

309313

310314
## 5. Model Diagnostics
311315

312316
After fitting the model, it's important to check its adequacy:
313-
314317

315318

316319
```python

public/index.json

+1-1
Large diffs are not rendered by default.

public/posts/finance/stock_prediction/sarima/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ <h2 id="4-sarima-model-implementation">4. SARIMA Model Implementation</h2>
758758
</span></span><span style="display:flex;"><span>plt<span style="color:#f92672">.</span>legend()
759759
</span></span><span style="display:flex;"><span>plt<span style="color:#f92672">.</span>show()
760760
</span></span></code></pre></div><p><img alt="png" src="/posts/finance/stock_prediction/sarima/images/sarima_example_9_1.png"></p>
761-
<p>As the prei</p>
761+
<p>As the previous plot shows, SARIMA model takes into account stagionality with respect to the <a href="%28/posts/finance/stock_prediction/arima/%29">ARIMA model</a> and provides better accuracy and <em>mape</em> score.</p>
762762
<h2 id="5-model-diagnostics">5. Model Diagnostics</h2>
763763
<p>After fitting the model, it&rsquo;s important to check its adequacy:</p>
764764
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#75715e"># Model diagnostics</span>

0 commit comments

Comments
 (0)