Returns values along a trend curve (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**- is the model description flag for the 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 a polynomial type of trend and is ignored for all others. If missing, POrder = 1.
**Const**- is the constant or the intercept value to fix (e.g., zero). If missing, an intercept will not be fixed and 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. 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, an alpha value of 5% is assumed.

## Remarks

- NxTrend supports the following trend functions:

$$ \begin{cases} \mathrm{Linear} & Y_t=\alpha + \beta \times t \\ \mathrm{Polynomial} & Y_t=\alpha + \beta_1 \times t + \beta_2 \times t^2 + \cdots + \beta_N \times t^N \\ \mathrm{Exponential:} & Y_t= \alpha \times e^{\beta \times t} \\ \mathrm{Logarithm:} & Y_t= \alpha + \beta \times \ln(t) \\ \mathrm{Power:} & Y_t= \alpha \times t^{\beta} \\ \end{cases} $$ - For exponential and logarithmic trends, the intercept value is not permitted to 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 function's coefficients that best fit your data are estimated using the "least squares" method.
- The time series may include missing values (e.g., #N/A) at either end.

## Files Examples

## Related Links

## 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.

## Comments

Article is closed for comments.