Specify some data:
>
|
|
Fit a linear model to the data:
>
|
|
| (2) |
It can be observed that from the plot of the data and the linear model that there is some upward trend.
>
|
|
The Detrend command removes any trend from the data.
>
|
|
This can be observed in the following plot:
>
|
|
Generate a random signal with an added trend.
>
|
|
>
|
|
Plot the signal and the trend line.
>
|
|
Plot the signal, the detrended signal, the trend line and the mean of the detrended data.
>
|
|