Optional parameters

Sometimes you might additionally want to specify an optional parameter for a Time series Easy Mining procedure, such as selecting a time series algorithm, setting the input and forecast horizon, getting the forecasts, and setting the length of a seasonal cycle.

For a listing of optional parameter strings, see Optional parameter strings.

With time series prediction mining function, you can use optional parameter strings for the following tasks:

Selecting a time series algorithm

Intelligent Miner® provides the following time series algorithms:
  • Arima
  • Exponential Smoothing
  • Seasonal Trend Decomposition

By default, the Easy Mining procedure BuildTsModel uses all of these algorithms. However, you might want to use only one of these algorithms. You can use the BuildTsModel procedure by specifying the following options:

ARIMA

DM_enableARIMA()
DM_disableARIMA()

Exponential Smooting

DM_enableExpSm()
DM_disableExpSm()

Seasonal Trend Decomposition

DM_enableSTD()
DM_disableSTD()
Example:
You might want to use only the ARIMA algorithm to build a time series model. The procedure call looks like this:
db2  ''call IDMMX.BuildTsModel('DWH.AIR_PASSENGER', 
                              'DWH.AIR_PASSENGER_DATA', 
		              'TIME',	
                              'VALUE', 
                              'DM_disableExpSm(),DM_disableSTD()')''

Setting the input period and the forecast horizon

Intelligent Miner time series modeling uses past values in a series to predict future values. By default, all values present in a column are considered when creating predictions of future values. This might not be desirable in all cases. There might be, for instance, cases in which some of the old values are outdated. Intelligent Miner allows you to set the period of time from which values should be drawn for prediction using the methods DM_setFromTime and DM_setToTime. Both take as single parameter a VARCHAR that must represent a point in time of the same type as the column selected as time field.

Intelligent Miner usually determines automatically up to which future point in time it can forecast. You can, however, specify the forecast horizon by using the DM_setForcHorizon parameter. It takes as parameter a VARCHAR that must represent a point in time of the same type as the column selected as time field.

Example:
You might want to use the input table DWH.AIR_PASSENGER_DATA to build the time series model DWH.AIR_PASSENGER by using data from 2009/04/06 to 2009/04/07 and setting the forecast horizon to 2009/04/12.
db2  ''call IDMMX.BuildTsModel('DWH.AIR_PASSENGER', 
                              'DWH.AIR_PASSENGER_DATA',
		              'TIME',	
                              'VALUE', 
                              'DM_setFromTime(''2009-04-06 05:04:14.0''),
                               DM_setToTime(''2009-04-07 06:03:09.0''), 
                               DM_setForcHorizon(''2009-04-12 00:00:00.0'')')”

Getting the forecasts

Time series models do not require an apply method. Unlike other mining models, they directly contain the forecasts of future values. How can you access these forecasts once the model is built? There is no EasyMining procedure to do this, however, you can use an almost equally simple SQL statement. The method to use depends on the type of the time column that should appear in the results:
  • getForcNumeric uses double values as time column
  • getForcDate uses date values as time column
  • getForcTime uses time values as time column
  • getForcTStamp uses timestamps as time column

All of these methods deliver a table containing columns for the name of the method, the target column, the time (of the type determined by which method was invoked), the forecasted value, and the confidence of the value. The following example shows how to apply it. In the given case, all forecasts of the previously trained model ‘DWH.AIR_PASSENGER' produced by the ARIMA algorithm are retrieved. For more information, see the Modeling documentation.

Example:
db2  ''select * from table (IDMMX.DM_getForcDate(( select MODEL from IDMMX.TIMESERIESMODELS     
               where modelname='DWH.AIR_PASSENGER') ) ) t WHERE method='ARIMA')''

Setting the season

You can specify the length of seasonal cycles for the Time Series algorithm to consider by using the method DM_setSeasonalCyc. This method uses the following parameters:

Name of the Column
A categorical text string
Time span
A numerical value
Unit of the time span
VARCHAR
The following units are valid:
  • seconds
  • minutes
  • hours
  • days
  • NULL or empty string ('') if <timeColumn> is numeric
Example:
You might want to use the input table DWH.AIR_PASSENGER_DATA to build the time series model DWH.AIR_PASSENGER with the length of a seasonal cycle defined as 365 days.
db2  ''call IDMMX.BuildTsModel('DWH.AIR_PASSENGER', 
                              'DWH.AIR_PASSENGER_DATA', 
	                      'TIME',	
                              'VALUE', 
                              'DM_setSeasonalCyc(''VALUE'',365, ''days'')')''


Feedback | Information roadmap