# The Forecasting Elements

Forecasting elements use a variety of techniques to produce projected values by analyzing existing values. The future values they "predict" are, in most cases, added as rows or columns to a datalayer so the data can be displayed along with the existing data. This topic discusses these elements.

Data forecasting is the process of generating values based on events that have not yet occurred. "Prediction" is a similar but more general term. Forecasting refers to formal, statistical methods that use time series, cross-sectional, or longitudinal data. Logi Forecast elements are applied as the children of datalayer elements (forecasting features available in some of our "super elements", such as the Analysis Chart, use separate elements and attributes that enable them). The forecasted data values are generated by analyzing the existing values in the datalayer, and the resulting "future" values are added to the datalayer so they can be displayed along with the existing values.

Typically, forecasts are displayed most effectively on charts. In the example shown above, quarterly freight costs have been forecast using a Time Series Decomposition method and are displayed as a dotted line on a bar chart. Data that best lends itself to forecasting can be:

• Time Series, consisting of data in a natural time-related order with a strong interval, where the "independent data" (X-axis) is of DateTime type and the "dependent data" (Y-axis) is a number. For example, "Product Sales by Month".
• Causal, consisting of dependent numeric values ordered by a numeric independent variable. Example: a count of unique website visitors and a count of the number of ads they clicked on.

There is no single correct forecasting method to use in any given situation. There are a large number of methods, including the following just for time series forecasts:

• Moving average
• Weighted moving average
• Exponential smoothing
• Autoregressive moving average (ARMA)
• Autoregressive integrated moving average (ARIMA) e.g. Box-Jenkins
• Extrapolation
• Linear prediction
• Trend estimation
• Growth curve
• Regression analysis

Some of these methods are easy to understand and some are not. The Logi Forecast elements use a combination of some of these methods.

## Using Forecast.Current Time Period

The Forecast.Current Time Period element produces its forecast by analyzing a value from the last row in the datalayer and "prorating" it into the future, through completion of a specific time period. Its calculations do not take working hours per day, holidays, or weekends into consideration.

The Forecast.Current Time Period element is a child of any datalayer, as shown above, and its attributes include:

 Attribute Description Data Column (Required) Specifies the name of a column in the datalayer that contains the values which will be "prorated" across the time period. DateTime Data Column (Required) Specifies the name of a column in the datalayer that contains date values (and, optionally, a time) that are the starting point in time from which to prorate the Data Column value. ID (Required) A unique element ID. Time Period (Required) Specifies the time period through which values should be forecast. Options include: Hour, Day, Week, Month, Quarter, Year. Forecast Difference Column ID Specifies the name of a new column that will be created in the datalayer to hold the value of the difference between the starting data value and each prorated forecast value. Forecast Indicator Column ID Specifies the name of a new column to be added to the datalayer, with value set to "True", for each row used in the forecast analysis. If left blank, the column will automatically be named "{ElementId}" + "ForecastIndicator" Forecast Value Column ID Specifies the name of a new column that will be created in the datalayer to hold each forecast value.

## Using Forecast.Regression

The Forecast.Regression element uses one of several regression analysis functions. Regression analysis is recommended when the focus is on a relationship between a dependent value and one or more independent values. It's useful, for example, when values in the X-axis are "uneven" (are separated by varying differences).

The Forecast.Regression element is a child of any datalayer, as shown above, and its attributes include:

 Attribute Description Dependent Data Column (Required) Specifies the name of a column returned into the datalayer. It represents data values for the Y-axis. ID (Required) A unique element ID. Independent Data Column (Required) Specifies the name of a column returned into the datalayer. It represents data values for the X-axis. Regression Type (Required) Specifies the type of regression analysis to be applied. Select Linear to calculate predictive values based on a trend line. Select Autoregressive when attempting to predict an output of a system based on previous outputs. The estimation technique used is based on "Burg's" method. Set the optional Autoregressive Order attribute (below) to define how many previous values to use. Select a non-linear regression type (Exponential, Logarithmic, Polynomial, or Power) to display the relationship between dependent and independent variables as a curvilinear function, which may provide more accuracy than a linear regression. Autoregressive Order Used only when Regression Type is set to Autoregressive. Specify a value between 1 - 8 (default = 3) to define how many previous values have to be observed for analysis. Forecast Indicator Column ID Specifies the name of a new column to be added to the datalayer, with value set to True, for each row used in the forecast analysis. If left blank, the column will automatically be named "{ElementId}" + "ForecastIndicator". Forecast Length Specifies the actual number of rows to analyze. A value entered that is greater than the total number of rows will be reduced to the total number of rows minus one. If left blank, 20% of the total number of rows will be used. Forecast Value Column ID Specifies the name of a new column that will be created in the datalayer to hold each forecast value. If this value is left blank, the forecast value will be added to the value of the Dependent Data Column.

## Using Forecast.Time Series Decomp

The Forecast.Time Series Decomp element uses a technique that's optimized for analyzing data across daily, weekly, or other time periods. The data to be analyzed should be grouped and detail rows discarded, so there is one data row for each time period. If possible, time intervals should be consistent, such as 12 months in a year, not 5 months spread across one year.

The Forecast.Time Series Decomp element is a child of any datalayer, as shown above, and its attributes include:

 Attribute Description Dependent Data Column (Required) Specifies the name of a column returned into the datalayer. It represents data values for the Y-axis. ID (Required) A unique element ID. Independent Data Column (Required) Specifies the name of a column returned into the datalayer. It represents data values for the X-axis. Cycle Time Span Specifies the periodic variation or cycle to be used in the analysis of the data. Options include: Hour: 1 day (a 24-hour cycle)Daily: 1 week (a 7-day cycle)Week: 1 month (a 4-week cycle)Month: 1 year (a 12-month cycle)Quarter: 1 year (a 4-quarter cycle)Year: 1 year (a 1-year cycle) Forecast Indicator Column ID Specifies the name of a new column to be added to the datalayer, with value set to True, for each row used in the forecast analysis. If left blank, the column will automatically be named "{ElementId}" + "ForecastIndicator". Forecast Length Specifies the actual number of rows to analyze. A value entered that is greater than the total number of rows will be reduced to the total number of rows minus one. If left blank, 20% of the total number of rows will be used. Forecast Value Column ID Specifies the name of a new column that will be created in the datalayer to hold each forecast value. If this value is left blank, the forecast value will be added to the value of the Dependent Data Column.