Machine Learning

AR

Usage

This function is used to learn the coefficients of the autoregressive models for a time series.

Name: AR

Input Series: Only support a single input numeric series. The type is INT32 / INT64 / FLOAT / DOUBLE.

Parameters:

  • p: The order of the autoregressive model. Its default value is 1.

Output Series: Output a single series. The type is DOUBLE. The first line corresponds to the first order coefficient, and so on.

Note:

  • Parameter p should be a positive integer.
  • Most points in the series should be sampled at a constant time interval.
  • Linear interpolation is applied for the missing points in the series.

Examples

Assigning Model Order

Input Series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d0.s0|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:01.000+08:00| -4.0|
  5. |2020-01-01T00:00:02.000+08:00| -3.0|
  6. |2020-01-01T00:00:03.000+08:00| -2.0|
  7. |2020-01-01T00:00:04.000+08:00| -1.0|
  8. |2020-01-01T00:00:05.000+08:00| 0.0|
  9. |2020-01-01T00:00:06.000+08:00| 1.0|
  10. |2020-01-01T00:00:07.000+08:00| 2.0|
  11. |2020-01-01T00:00:08.000+08:00| 3.0|
  12. |2020-01-01T00:00:09.000+08:00| 4.0|
  13. +-----------------------------+---------------+

SQL for query:

  1. select ar(s0,"p"="2") from root.test.d0

Output Series:

  1. +-----------------------------+---------------------------+
  2. | Time|ar(root.test.d0.s0,"p"="2")|
  3. +-----------------------------+---------------------------+
  4. |1970-01-01T08:00:00.001+08:00| 0.9429|
  5. |1970-01-01T08:00:00.002+08:00| -0.2571|
  6. +-----------------------------+---------------------------+