<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ali Akil on Medium]]></title>
        <description><![CDATA[Stories by Ali Akil on Medium]]></description>
        <link>https://medium.com/@aliakil87?source=rss-81b46c16b23b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NA4ubeRsBzIYtaeX</url>
            <title>Stories by Ali Akil on Medium</title>
            <link>https://medium.com/@aliakil87?source=rss-81b46c16b23b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:05:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aliakil87/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Foray Into Time Series]]></title>
            <link>https://medium.com/@aliakil87/a-foray-into-time-series-4e22e51cd708?source=rss-81b46c16b23b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e22e51cd708</guid>
            <dc:creator><![CDATA[Ali Akil]]></dc:creator>
            <pubDate>Tue, 13 Jan 2026 14:15:26 GMT</pubDate>
            <atom:updated>2026-01-13T14:15:26.660Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DucnJgLrsiJrbLucuPZQBg.png" /></figure><p>As a Data Science student, I’ve been exploring time series analysis and forecasting models over the past few weeks, and I’ve been pleasantly surprised by how deep and interesting this subject turned out to be. I began with stock market data and other readily available datasets.</p><p>However, I quickly realized that the best way to learn is to apply these methods to real-world data. So, I chose the London air quality dataset. Although it includes six different air pollutants across five locations, I decided to narrow my focus to one pollutant at one location. After all, my goal is to learn time series and forecasting, not to become an expert on London’s air quality!</p><p>The first step was to examine the dataset and check for null values, anomalies, formatting issues, variance, and other basic data exploration considerations to prepare the data for modeling. Handling missing values gave me pause; I wasn’t sure which approach to take. Should I fill today’s value with yesterday’s? Use the mean between surrounding values? I eventually went with forward fill, but this highlighted the nuance of dealing with missing data in time series specifically. Because the sensors recorded hourly measurements for almost 14 years, I resampled the data to reduce computation time and to create smoother, more interpretable plots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*Y3ev-n85FKPnpOkTXtGWmg.png" /><figcaption>Me manipulating the data if you can’t tell.</figcaption></figure><p>Through exploration and decomposition, the NO₂ levels (the pollutant I focused on) showed a clear downward trend over the years. Seasonality, however, didn’t become obvious until I resampled the data to weekly and monthly levels. Winter months and early mornings showed particularly high levels, likely due to heating, traffic byproducts, and colder, denser air.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*SYQt_RsI9FZiZqEGLAa6kQ.png" /></figure><p>I first experimented with simpler forecasting approaches: naïve forecasts, seasonal naïve forecasts, moving averages, autoregressive models, mean forecasts, and the drift method. These baseline models performed reasonably well when the time series had low variance and limited complexity.</p><p>Eventually it became clear that I needed more advanced tools. This led me to study stationarity and autocorrelation. The ACF and PACF plots were especially helpful in understanding how daily measurements related to previous values. Exploring different lag windows gave me better intuition about the data and suggested possible modeling directions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*-JLCVzRFWDikNKtm-vdWPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*SaXONFlWhPn0vO_MZ8DewQ.png" /></figure><p>Next, I turned to ARIMA and SARIMA, great acronyms! They provided more flexible frameworks and additional parameters to tune. At first, my predictions performed poorly, and I discovered that non-stationarity was the culprit. After differencing the series, the results improved, but the forecasts were still underwhelming, and the error metrics I implemented (MAE, RMSE, MAPE) suggested that even my “best” model would likely struggle in a real-world forecasting context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*T3J80f8efWiJXXtP5-ng5g.png" /></figure><p>I then moved on to Prophet by Meta, a tool I had never used before, with a name that certainly projects confidence. Surprisingly, I found Prophet very useful, especially with cross-validation, grid search, customized seasonality, and holiday effects. I also imported weather data covering the same period, which significantly improved the forecasts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*8VlKGjHnDg2z08XwFFlV6Q.png" /></figure><p>However, one key lesson became clear: no matter what I did, perfect forecasting was impossible. That is probably the most important takeaway from this entire exploration. Forecasting the future is inherently uncertain. Although “all models are wrong, some are useful,” most models will be relatively flat, with limited ability to predict rare shocks or “black swan” events, and we usually don’t want them to, because that would risk overfitting.</p><p>The major outcome of this journey into time series and forecasting has been learning to recognize which datasets and problems are appropriate for these methods, and understanding the limits of both the tools and my current abilities. If you bet the house on a model’s forecast, you might win for a short while, but eventually an unexpected event will happen that the model cannot predict. To forecast the future with complete accuracy, you’d need to model the entire universe, not just a handful of variables.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e22e51cd708" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>