hanaml.VectorARIMA is a R wrapper for SAP HANA PAL Vector AutoregRessive Moving Average.

hanaml.VectorARIMA(
  data = NULL,
  key = NULL,
  endog = NULL,
  exog = NULL,
  order = NULL,
  seasonal.order = NULL,
  model.type = NULL,
  search.method = NULL,
  lag.num = NULL,
  max.p = NULL,
  max.q = NULL,
  max.seasonal.p = NULL,
  max.seasonal.q = NULL,
  max.lag.num = NULL,
  init.guess = NULL,
  information.criterion = NULL,
  include.mean = NULL,
  max.iter = NULL,
  finite.diff.accuracy = NULL,
  displacement = NULL,
  ftol = NULL,
  gtol = NULL,
  calculate.hessian = NULL,
  calculate.irf = NULL,
  irf.lags = NULL,
  alpha = NULL,
  output.fitted = NULL,
  thread.ratio = NULL
)

Arguments

data

DataFrame
DataFrame includes key, endogenous variables and exogenous variables.

key

character, optional
Name of the key. The type of key column is integer.
If not provide, defaults to the first column.

endog

list of characters, optional
The endogenous variable, i.e. time series. The type of endog column is integer or double.
Defaults to the non-key and non-exog columns of data if not provided.

exog

list of characters, optional
The exogeneous variables.
Defaults to NULL.

order

list/vector of integer, optional
Indicate the order (p, d, q).

  • p: value of the auto regression order. -1 indicates auto and >=0 is user-defined.

  • d: value of the differentiation order.

  • q: value of the moving average order. -1 indicates auto and >=0 is user-defined.

Defaults to c(-1, 0, -1).

seasonal.order

list/vector of integer, optional
Indicate the seasonal order (P, D, Q, s).

  • P: value of the auto regression order for the seasonal part. -1 indicates auto and >=0 is user-defined.

  • D: value of the differentiation order for the seasonal part.

  • Q: value of the moving average order for the seasonal part. -1 indicates auto and >=0 is user-defined.

  • s: value of the seasonal period. -1 indicates auto and >=0 is user-defined.

Defaults to c(-1, 0, -1, 0).

model.type

c('VAR', 'VMA', 'VARMA'), optional
The model type.
Defaults to 'VARMA'.

search.method

c('eccm', 'grid.search'), optional
Specifies the orders of the model. 'eccm' is valid only when seasonal period is less than 1.
Defaults to 'grid.search'.

lag.num

integer, optional
The lag number of explanatory variables. Valid only when model.type='VAR'.
Defaults to 0.05.

max.p

integer, optional
The maximum value of vector AR order p.
Defaults to 6 if model.type='VAR' or if model.type='VARMA' and search.method='eccm'.
Defaults to 2 if model.type='VARMA' and search.method='grid.search'.

max.q

integer, optional
The maximum value of vector MA order q.
Defaults to 8 if model.type='VMA'.
Defaults to 5 if model.type='VARMA' and search.method='eccm'.
Defaults to 2 if model.type='VARMA' and search.method='grid.search'.

max.seasonal.p

integer, optional
The maximum value of seasonal vector AR order P.
Defaults to 3 if model.type='VAR'.
Defaults to 1 if model.type='VARMA' and search.method='grid.search'.

max.seasonal.q

integer, optional
The maximum value of seasonal vector MA order Q.
Defaults to 1.

max.lag.num

, optional
The maximum lag number of explanatory variables. Valid only when model.type='VAR'.
Defaults to 4.

init.guess

integer, optional
The model used as initial estimation for VARMA. Valid only for VARMA.
Defaults to 'VAR'.

information.criterion

character, optional
'AIC', 'BIC', optional Information criteria for order specification.
Defaults to 'AIC'.

include.mean

logical, optional
ARMA model includes a constant part if TRUE.
Valid only when d + D <= 1.
Defaults to TRUE if d + D = 0 else FALSE.

max.iter

integer, optional
Maximum number of iterations of L-BFGS-B optimizer. Valid only for VMA and VARMA.
Defaults to 200.

finite.diff.accuracy

integer, optional
Polynomial order of finite difference.
Approximate the gradient of objective function with finite difference.
The valid range is from 1 to 4. Defaults to 1.

displacement

double, optional
The step length for finite-difference method. Valid only for VMA and VARMA.
Defaults to 2.2e-6.

ftol

double, optional
Tolerance for objective convergence test. Valid only for VMA and VARMA. Defaults to 1e-5.

gtol

doulbe, optional
Tolerance for gradient convergence test. Valid only for VMA and VARMA.
Defaults to 1e-5.

calculate.hessian

logical, optional
Specifies whether to calculate the Hessian matrix.
VMA and VARMA will output standard error of parameter estimates only when calculate.hessian is TRUE.
Defaults to FALSE.

calculate.irf

logical, optional
Specifies whether to calculate impulse response function.
Defaults to FALSE.

irf.lags

integer, optional
The number of lags of the IRF to be calculated. Valid only when calculate.irf is TRUE.
Defaults to 8.

alpha

double, optional
Type-I error used in the Ljung-Box tests and eccm.
Defaults to 0.05.

output.fitted

logical, optional
Output fitted result and residuals if TRUE.
Defaults to TRUE.

thread.ratio

double, optional
Controls the proportion of available threads that can be used by this function.
The value range is from 0 to 1, where 0 indicates a single thread, and 1 indicates all available threads.
Values between 0 and 1 will use up to that percentage of available threads.Values outside this range are ignored.
Defaults to 0.

Value

Returns an "VectorARIMA" object with the following attributes:

  • model: DataFrame
    Fitted model.

  • fitted: DataFrame
    Predicted dependent variable values for training data. Set to NULL if the training data has no row IDs.

  • irf: DataFrame
    Impulse response function.

Details

The vector autoregressive moving average models (VARMA) is a vector form of autoregressive integrated moving average (ARMA) that can be used to examine the relationships among several variables in multivariate time series analysis, comparing to ARMA which is used in univariate time series.

Examples

Input DataFrame data:


> data$Collect()
  TIMESTAMP       Y
1         1 -24.525
2         2  34.720
3         3  57.325
4         4  10.340
5         5 -12.890
......

Invoke the function:


> varima <- hanaml.VectorARIMA(data = data, search.strategy = 1)

Output:


> varima$fitted
    TIMESTAMP      FITTED   RESIDUALS
1           1          NA          NA
2           2          NA          NA
3           3          NA          NA
4           4          NA          NA
5           5 -24.5250000 11.63500000
6           6  37.5839311  1.46106885
7           7  57.9926243 -0.69262431
8           8   8.6228706 -1.88787060
9           9 -20.3259208  0.96092077