{% extends "global/Page.html" %} {% load otree static %} {% block title %} Algorithm Support {% endblock %} {% block content %} An algorithm has determined a demand forecast for the {{ total_number_products }} products. It calculates the forecast for a product by following three steps: 1 - conducting a linear regression, 2 - checking for a trend in the demand history and 3 - computing a forecast that considers a trend if applicable.

In the following, the procedure of the algorithm is explained in detail:

1 - Linear Regression
The algorithm determines a linear function with the time as the independent variable and the function value as the dependent variable that fits best to the demand history. The parameters of the linear function, that is, the intercept and the slope, are determined, such that the sum of the squared distances between the function values and the actual historical demands is minimized. This method is called linear regression. This estimation describes a linear relationship between time \(t\) and demand. Mathematically, it can be written as:
\[\text{Demand for Period t} = a+b*t\] The coefficient \(a\) is the intercept at \(t=0\). The coefficient \(b\) indicates how the demand changes from period to period and is referred to as slope.

2 - Trend Check
The algorithm uses the \(p\)-value as an indication of the significance of the slope. The \(p\)-value states the probability that the slope parameter is not significant. A non-significant slope parameter \((p\geq5\%\)) indicates that the demand data have no trend.

3 - Forecast
If the \(p\)-value is less than 5%, the estimation of Step 1 is used to calculate the forecast of Period \(t=11\):
\[\text{Demand Forecast for Period 11} = a+b*11\] If the \(p\)-value is greater than or equal to 5%, the regression of Step 1 is repeated with a constraint on the slope of \(b=0\).
\[\text{Demand Forecast for Period 11} = c\]


Example 1



The algorithmic demand forecast for Period \(t=11\) is computed by:

1 - Linear Regression
The demand estimation that fits best into the demand history is:
\[\text{Demand for Period t} = 407+17*t\] 2 - Trend Check
The slope parameter is not significant (\(p=41\%>5\%\)).

3 - Forecast
The algorithm fits a linear regression without trend. The demand forecast for Period \(t=11\) is: \(500\)




Example 2



The algorithmic demand forecast for Period \(t=11\) is computed by:

1 - Linear Regression
The demand estimation that fits best into the demand history is:
\[\text{Demand for Period t} = 360+27.27*t\] 2 - Trend Check
The slope parameter is significant (\(p=3\%<5\%\)).

3 - Forecast
The algorithm uses the linear regression with trend. The demand forecast for Period \(t=11\) is: \(360+27.27*11\approx660\).

In the following, you will see the {{ total_number_products }} products again. You will see your initial forecast and the forecast of the algorithm. If you wish, you can update your final forecast for the product.

Your bonus reward will only depend on the final forecast.


Please tell us what you think about the algorithm:
{{ questionnaire_1 }}



Please answer all questions to continue.

{{ formfield_errors 'questions_aft_explain_answers' }} {% endblock %}