<?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 Prokop Trojan on Medium]]></title>
        <description><![CDATA[Stories by Prokop Trojan on Medium]]></description>
        <link>https://medium.com/@prokoptrojan?source=rss-2fb93ae5a286------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sgRCHho4gyapkm7DS0_ZbQ.png</url>
            <title>Stories by Prokop Trojan on Medium</title>
            <link>https://medium.com/@prokoptrojan?source=rss-2fb93ae5a286------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 10:47:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prokoptrojan/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[Simple Business Application of Monte Carlo Simulation — Campaign Response Prediction]]></title>
            <link>https://medium.com/@prokoptrojan/simple-business-application-of-monte-carlo-simulation-campaign-response-prediction-51ce61917844?source=rss-2fb93ae5a286------2</link>
            <guid isPermaLink="false">https://medium.com/p/51ce61917844</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[campaign-management]]></category>
            <category><![CDATA[monte-carlo]]></category>
            <dc:creator><![CDATA[Prokop Trojan]]></dc:creator>
            <pubDate>Sun, 30 Aug 2020 13:26:38 GMT</pubDate>
            <atom:updated>2020-09-20T18:41:15.797Z</atom:updated>
            <content:encoded><![CDATA[<h3>Applying monte carlo simulation to campaign response prediction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZO6uiZufP1tnaJp3GvjPJw.jpeg" /></figure><p>Monte Carlo simulation is a widely used model as an enhancement of basic statistics found in excel — essentially, one of the easiest ways of mitigating the fallacy of averages. It can be best described as a process of multiple simulation through random variables to generate an output.</p><p>The use-case I have chose to model this on is campaign response. It is a very simple use-case that requires minimum effort, and really helps bring a more accurate perspective when dealing with budgeting, infrastructure, and capacity preparation.</p><h3>Code:</h3><pre>import numpy as np<br>import pandas as pd<br>import matplotlib.pyplot as plt</pre><p>The principle of this function is very simple. By providing a standard deviation around a historical average for a similar type of campaign, I can run a while loop with as many times random response rate as I define to give me an output.</p><pre>def campaign_target(campaign_target, low_sigma, high_sigma, number_of_iterations):</pre><pre>df = []</pre><pre>x = 0</pre><pre>while x &lt; number_of_iterations:</pre><pre>range_percent = np.random.uniform(low_sigma,high_sigma)<br>campaign_total = campaign_target</pre><pre>response = campaign_total * range_percent</pre><pre>df.append(response)</pre><pre>x += 1</pre><pre>final_result = pd.DataFrame(df)<br>    <br>    print(final_result.describe()) <br>    <br>    plt.plot(df, linewidth = 0.4)<br>    plt.show()</pre><p>The campaign parameters I have chosen are as follows; 1.100.000 target clients to reach, 0.30 low average response on historical campaign, 0.35 high average response on historical campaign, and a total of 100 iterations.</p><pre>campaign_target(1100000,0.30,0.35,100)</pre><h3>Results:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*lcezQk1iaTc3q3bpJ6gD8Q.png" /></figure><p>After running this function 100 times using numpys random generator within our sigma, we end with a mean result of 357k responses. If, for example we were to use the 0.4 average campaign response given to us (by campaign management teams), we would plan for a target response of 440k responses — a delta of 83k responses.</p><p>As more of a business person myself, this delta can create a large range of issues throughout and after the campaign run — under utilised resources, extended target end dates, over budgeted teams.</p><p>By using less than 20 lines of python code we can greatly enhance out strategic planning when it comes to campaign management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51ce61917844" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting European Price Stability (HICP) using ARIMA modelling]]></title>
            <link>https://medium.com/analytics-vidhya/predicting-european-price-stability-hicp-using-arima-modelling-c251be1b95?source=rss-2fb93ae5a286------2</link>
            <guid isPermaLink="false">https://medium.com/p/c251be1b95</guid>
            <category><![CDATA[arima]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[inflation]]></category>
            <dc:creator><![CDATA[Prokop Trojan]]></dc:creator>
            <pubDate>Mon, 03 Aug 2020 19:34:05 GMT</pubDate>
            <atom:updated>2020-08-08T16:48:17.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*pTOk5VmoO-HK59UoKNCsMA.jpeg" /></figure><h3><strong>INTRODUCTION</strong></h3><p>One of the most anticipated figures released by the ECB in Q3 is its widely accepted measure of inflation; <a href="https://ec.europa.eu/eurostat/web/hicp">Harmonised Index of Consumer Prices</a>. This data will help economists gain a better understanding of where we are in terms of recovery from the first shock of COVID-19.</p><p>As I have been recently interested in time-series modelling, I have decided to predict this Q3 inflation result using a simple ARIMA modelling method in python.</p><p><strong>ARIMA</strong> stands for AutoRegressive Integrated Moving Average. It is a simple tool used to predict time series data. The model consists of 3 parameters:</p><ul><li>p: The number of lag observations included in the model, also called the lag order.</li><li>d: The number of times that the raw observations are differenced, also called the degree of differencing.</li><li>q: The size of the moving average window, also called the order of moving average.</li></ul><p>I have run the model using data collected from <a href="https://sdw.ecb.europa.eu/">ECB statistical data warehouse</a>.</p><h3>METHOD</h3><p>My code is split into 3 simple sections, data cleaning and processing, statistical testing, and, model building and data interpretation. I will not go into much detail of the code itself, but will rather try to present the method and outcomes.</p><ul><li>Data cleaning and processing:</li></ul><pre>#package import<br>import pandas as pd<br>import matplotlib.pyplot as plt<br>import numpy as np<br>from statsmodels.tsa.arima_model import ARIMA<br>from statsmodels.graphics.tsaplots import plot_acf,plot_pacf<br>from pandas.plotting import autocorrelation_plot</pre><pre>#data download and cleaning<br>data = pd.read_excel(&#39;/Users/prokoptrojan/Documents/HICP_HIST.xlsx&#39;, index_col = &#39;date&#39;, parse_dates=True, squeeze=True)</pre><pre>df = data[&#39;s1&#39;]<br>df.index = pd.DatetimeIndex(df.index).to_period(&#39;M&#39;)<br>print(df)</pre><pre>df.plot(title = &#39;HICP DATA&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0GQjjgE90oqY69w0i8Glrw.png" /></figure><ul><li>Initial statistical tests:</li></ul><pre>#differencing<br>df1 = df.diff(periods=1)<br>df2 = df1.dropna()<br>print(df1.head())</pre><pre>#PACF testing<br>df1.plot(title = &#39;Differenced Time Series (-1)&#39;)<br>plt.show()</pre><pre>plot_pacf(df)<br>plt.show()</pre><pre>autocorrelation_plot(df)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_6fX6Hfie3OK1XHTo4eCug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MCcSyGtgGJapgg8Utc7r3Q.png" /></figure><ul><li>Model build and result interpretation:</li></ul><pre>#build ARIMA and interpret results<br>model = ARIMA(df, order=(2,1,0))<br>model_fit = model.fit(disp=0)<br>print(model_fit.summary())</pre><pre>model_fit.plot_predict(250,284)<br>plt.show()</pre><pre>final = model_fit.predict(280,284,typ=&#39;levels&#39;)<br>print(final)</pre><p>The p value was chosen because of the initial PACF test in the 2nd step of our code; after 2 lags we lost significant autocorrelation. The d value was chosen because the initial data set given did not possess the stationarity criteria. The q value was chosen because there is no need to set a moving average. As with any model, I ran a couple of iterations before finding the most suitable fit.</p><h3>RESULTS AND CONCLUSION</h3><p>With a model built on an order of 2,1,0 and a final AIC score of 14.125 we get a result of 0,32% inflation recorded for Q3. A slight drop from a Q2 value of 0,33%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fioh_HSB-emG4r-lSK7N-A.png" /></figure><p>How accurate is this forecast? Probably not very much. Given the uncertainty and complexity in today&#39;s economic climate, a lot more sophisticated models are needed. I will of course be following up and let you know how close I got when the actual results get published!</p><p>Thanks to:</p><p><a href="https://machinelearningmastery.com/arima-for-time-series-forecasting-with-python/">How to Create an ARIMA Model for Time Series Forecasting in Python - Machine Learning Mastery</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c251be1b95" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/predicting-european-price-stability-hicp-using-arima-modelling-c251be1b95">Predicting European Price Stability (HICP) using ARIMA modelling</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>