Teradata Package for R Function Reference | 17.00 - Arima - Teradata Package for R - Look here for syntax, methods and examples for the functions included in the Teradata Package for R.

Teradata® Package for R Function Reference

Product
Teradata Package for R
Release Number
17.00
Published
July 2021
Language
English (United States)
Last Update
2023-08-08
dita:id
B700-4007
NMT
no
Product Category
Teradata Vantage
Arima

Description

The Arima function calculates the coefficients for a sequence of parameters, producing an ARIMA model that is typically input to the ArimaPredictor (td_arima_predict_mle) function.

Usage

  td_arima_mle (
      data = NULL,
      orders.table = NULL,
      timestamp.columns = NULL,
      value.column = NULL,
      orders = NULL,
      seasonal = NULL,
      period = NULL,
      include.mean = FALSE,
      partition.columns = NULL,
      max.iterations = 10000,
      method = "SSE",
      include.drift = FALSE,
      order.p = NULL,
      order.d = NULL,
      order.q = NULL,
      seasonal.order.p = NULL,
      seasonal.order.d = NULL,
      seasonal.order.q = NULL,
      data.sequence.column = NULL,
      orders.table.sequence.column = NULL
  )

Arguments

data

Required Argument.
Specifies the name of the tbl_teradata that contains the input parameters.

orders.table

Optional Argument.
Specifies the name of the orders tbl_teradata that is generated by TimeSeriesOrders function.

timestamp.columns

Required Argument.
Specifies the names of the columns in "data" tbl_teradata that specify the sequence (time points) of the input parameters. The sequence must have uniform intervals.
Types: character OR vector of Strings (character)

value.column

Required Argument.
Specifies the name of the column that contains the time series data in input tbl_teradata.
Types: character

orders

Optional Argument.
Specifies the comma separated string of integers values of the non-seasonal orders p, d, and q for the ARIMA model. The p and q must be an integer between 0 and 10, inclusive. The d must be between 0 and 1, inclusive.
Types: character

seasonal

Optional Argument.
Specifies the comma separated string of integers values of the seasonal orders sp, sd, and sq for the ARIMA model. The sp and sq must be an integer between 0 and 10, inclusive. The sd must be between 0 and 3, inclusive
Types: character

period

Optional Argument.
Specifies the period of a season (m in the formula). This value must be a positive integer value. If you specify seasonal, then you must also specify period.
Types: integer

include.mean

Optional Argument.
Specifies whether the function adds the mean value (c in the formula) to the arima model.
Note: If "include.mean" is TRUE, then both d in orders and sd in seasonal must be 0.
Default Value: FALSE
Types: logical

partition.columns

Optional Argument.
Specifies the partition columns that will be passed to the output. If not specified, the output will not contain partition columns.
Types: character OR vector of Strings (character)

max.iterations

Optional Argument.
Specifies the maximum iteration number for estimating the parameters. This value must be a positive integer.
Default Value: 10000
Types: integer

method

Optional Argument.
Specifies the method for fitting the model parameters:

  1. SSE: Sum of squared error.

  2. ML: Maximum likelihood.

Default Value: "SSE"
Permitted Values: SSE, ML
Types: character

include.drift

Optional Argument.
Specifies whether drift term is included in the ARIMA model.
Note: This argument can only be TRUE when d is non-zero and less than 2.
Default Value: FALSE
Types: logical

order.p

Optional Argument.
Specifies the p value of the non-seasonal order parameter. The p value must be an integer between 0 and 10, inclusive.
Types: integer

order.d

Optional Argument.
Specifies the d value of the non-seasonal order parameter. The d value must be an integer between 0 and 1, inclusive.
Types: integer

order.q

Optional Argument.
Specifies the q value of the non-seasonal order parameter. The q value must be an integer between 0 and 10, inclusive.
Types: integer

seasonal.order.p

Optional Argument.
Specifies the sp value of the seasonal order parameter. The sp value must be an integer between 0 and 10, inclusive.
Types: integer

seasonal.order.d

Optional Argument.
Specifies the sd value of the seasonal order parameter. The sd value must be an integer between 0 and 3, inclusive.
Types: integer

seasonal.order.q

Optional Argument.
Specifies the sq value of the seasonal order parameter. The sq value must be an integer between 0 and 10, inclusive.
Types: integer

data.sequence.column

Optional Argument.
Specifies the vector of column(s) that uniquely identifies each row of the input argument "data". The argument is used to ensure deterministic results for functions which produce results that vary from run to run.
Types: character OR vector of Strings (character)

orders.table.sequence.column

Optional Argument.
Specifies the vector of column(s) that uniquely identifies each row of the input argument "orders.table". The argument is used to ensure deterministic results for functions which produce results that vary from run to run.
Types: character OR vector of Strings (character)

Value

Function returns an object of class "td_arima_mle" which is a named list containing objects of class "tbl_teradata".
Named list members can be referenced directly with the "$" operator using the following names:

  1. coefficient

  2. residual.table

  3. output

Examples

  
    # Get the current context/connection
    con <- td_get_context()$connection
    
    # Load example data.
    loadExampleData("arima_example", "milk_timeseries")

    # Create object(s) of class "tbl_teradata".
    milk_timeseries <- tbl(con, "milk_timeseries")

    # Example 1: Generate Arima model using only orders paremeter without 
    # "partition.columns" and seasonal parameters.
    td_arima_out <- td_arima_mle(data = milk_timeseries,
                             timestamp.columns = c("period"),
                             value.column = "milkpound",
                             orders = "0,1,2",
                             include.drift=TRUE)

    # Example 2: Generate Arima model using seasonal orders parameter.
    td_arima_out <- td_arima_mle(data = milk_timeseries,
                             timestamp.columns = c("period"),
                             value.column = "milkpound",
                             orders = "0,1,2",
                             seasonal.order.p = 0,
                             seasonal.order.d = 1,
                             seasonal.order.q = 1,
                             period = 12)