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

Teradata® R Package Function Reference

Product
Teradata R Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-28
dita:id
B700-4007
lifecycle
previous
Product Category
Teradata Vantage

Description

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

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 object or view that contains the input parameters.

orders.table

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

timestamp.columns

Required Argument.
Specifies the names of the input table columns that specify the sequence (time points) of the input parameters. The sequence must have uniform intervals.

value.column

Required Argument.
Specifies the name of the column that contains the time series data in input table.

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 integers between 0 and 10, inclusive. The d must be between 0 and 1, inclusive.

seasonal

Optional Argument.
Specifies the values of the seasonal orders sp, sd, and sq for the ARIMA model. The sp and sq must be integers between 0 and 10, inclusive. The sd must be between 0 and 3, inclusive.

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.

include.mean

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

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.

max.iterations

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

method

Optional Argument.
Specifies the method for fitting the model parameters:
SSE: Sum of squared error.
ML: Maximum likelihood.
Default Value: "SSE"
Permitted Values: SSE, ML

include.drift

Optional Argument.
Specify 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

order.p

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

order.d

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

order.q

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

seasonal.order.p

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

seasonal.order.d

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

seasonal.order.q

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

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.

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.

Value

Function returns an object of class "td_arima_mle" which is a named list containing Teradata tbl objects.
Named list members can be referenced directly with the "$" operator using 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 remote tibble objects.
    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)