**Have a Question?**

**Phone:** +1 (888) 427-9486

+1 (312) 257-3777

Contact Us

# NxTrend

Returns the value of a trend function (e.g. linear, quadratic, exponential, etc.) at time T+m.

## Syntax

**NxTrend**(

**X**,

**Order**,

**Trend_type**,

**POrder**,

**const**,

**Horizon**,

**Return_type**,

**Alpha**)

**X**

is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)).

**Order**

is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).

Order | Description |
---|---|

1 | ascending (the first data point corresponds to the earliest date) (default) |

0 | descending (the first data point corresponds to the latest date) |

**Trend_type**

are the model description flag for trend function; 1=Linear (default), 2=Polynomial, 3=Exponential, 4=Logarithmic, 5=Power.

Order | Description |
---|---|

1 | Linear (default) |

2 | Polynomial |

3 | Exponential |

4 | Logarithmic |

5 | Power |

**POrder**

is the polynomial order. This is only relevant for polymial type of trend, and ignored for all others. If missing, POrder=1.

**const**

is the constant or the intercept value to fix (e.g. zero). If missing, intercept will not be fixed is computed normally.

**Horizon**

is the forecast time/horizon beyond the end of X. If missing, a default value of 0 (Latest or end of X) is assumed.

**Return_type**

is a switch to select the return output ( 1 = Forecast value (default), 2= Upper limit, 3= Lower Limit, 4= R-Squared ).

Method | Description |
---|---|

1 | Forecast value (default) |

2 | C.I^{i}. Upper limit |

3 | C.I. Lower limit |

4 | R-Squared |

**Alpha**

is the statistical significance or confidence level (i.e. alpha). If missing or omitted, alpha is assumed 5%)

## Remarks

- NxTrend enhances the support of
**trend in Excel**; it supports the following trend functions:

- For exponential and logarithmic trend in Excel functions, the intercept value is not permitted be fixed, and thus is ignored.
- The Excel trend built-in function (i.e. "TREND") is a different function, not part of NumXL and should not be confused with NxTrend.
- The polynomial order argument must be a positive integer.
- The trend in Excel function's coefficients values that best fits your data are estimated using the "least squares" method.
- The time series may include missing values (e.g. #N/A) at either end.

## Examples

**Example 1: **

A | B | C | D | |
---|---|---|---|---|

1 | Date | Data | ||

2 | January 10, 2008 | -0.30 | #N/A | |

3 | January 11, 2008 | -1.28 | -0.3 | |

4 | January 12, 2008 | 0.24 | -2.26 | |

5 | January 13, 2008 | 1.28 | 0.01 | |

6 | January 14, 2008 | 1.20 | 1.15 | |

7 | January 15, 2008 | 1.73 | 1.44 | |

8 | January 16, 2008 | -2.18 | 2.03 | |

9 | January 17, 2008 | -0.23 | 0.34 | |

10 | January 18, 2008 | 1.10 | 0.07 | |

11 | January 19, 2008 | -1.09 | 0.31 | |

12 | January 20, 2008 | -0.69 | -0.30 | |

13 | January 21, 2008 | -1.69 | -0.72 | |

14 | January 22, 2008 | -1.85 | -1.42 | |

15 | January 23, 2008 | -0.98 | -2.04 | |

16 | January 24, 2008 | -0.77 | -2.08 | |

17 | January 25, 2008 | -0.30 | -1.83 | |

18 | January 26, 2008 | -1.28 | -1.28 | |

19 | January 27, 2008 | 0.24 | -1.19 | |

20 | January 28, 2008 | 1.28 | -0.45 | |

21 | January 29, 2008 | 1.20 | 0.64 | |

22 | January 30, 2008 | 1.73 | 1.46 | |

23 | January 31, 2008 | -2.18 | 2.24 | |

24 | February 1, 2008 | -0.23 | 0.93 | |

25 | February 2, 2008 | 1.10 | 0.44 | |

26 | February 3, 2008 | -1.09 | 0.60 | |

27 | February 4, 2008 | -0.69 | -0.21 | |

28 | February 5, 2008 | -1.69 | -0.72 | |

29 | February 6, 2008 | -1.85 | -1.53 | |

30 | February 7, 2008 | -0.98 | -2.19 |

## References

- Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0-691-04289-6
- Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0-471-690740