hanaml.Correlation {hana.ml.r}R Documentation

Correlation

Description

hanaml.Correlation is a R wrapper for PAL correlation.

Usage

hanaml.Correlation(conn.context,
                          data,
                          key,
                          cols,
                          thread.ratio = NULL,
                          method = NULL,
                          max.lag = NULL,
                          calculate.pacf = NULL)

Arguments

conn.context

ConnectionContext
Connection to SAP HANA System

data

DataFrame
Dataset used for correlation calculation.

key

character
Name of the ID column in data.

cols

list of character, optional
Specifies the columns in data for correlation calculation. If only one column is specified, then the auto-correlation of that column will be calculated.
Defaults to the 1st non-ID column in data.

thread.ratio

double, optional
Controls the proportion of available threads to use. The ratio of available threads.

  • 0: single thread.

  • 0~1: percentage.

  • Others: heuristically determined.

Defaults to -1.

method

("auto", "brute_force", "fft"), optional
Indicates the method to be used to calculate the correlation function.
Defaults to 'auto', i.e. automatically determined.

max.lag

integer, optional
Maximum lag for the correlation function. Defaults to sqrt(n), where n is the data number.

calculate.pacf

logical, optional
Controls whether to calculate PACF or not. Valid only when only one series is provided.
Defaults to 1.

Value

DataFrame

Examples

## Not run: 
Input DataFrame data:
> data$Collect()
    TIMESTAMP  Y
 1          1 88
 2          2 84
 3          3 85
 4          4 85
 5          5 84
 6          6 85
 7          7 83
 8          8 85
 9          9 88
 10         9 89

Invoke the function:
>  cr <- hanaml.Correlation(conn, data, key="TIMESTAMP",
                            cols = c("Y"),
                            thread.ratio = 0.4,
                            method = 'auto',
                            calculate.pacf = TRUE)

Output:
> cr$Collect()
  LAG     CV          CF       PACF
1   0  3.640  1.00000000  1.0000000
2   1  0.924  0.25384615  0.2538462
3   2 -0.292 -0.08021978 -0.1546211
4   3 -0.628 -0.17252747 -0.1201993

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]