Several short subroutines are given which use either of the above
methods to detrend and retrend a time series. They are presented
without explanation, as they are straightforward implementations of
the formulas already discussed.
/*
Forward declarations
of
local routines
7
void detrendjsq
(
double *source
,
int n
,
double *dest,
double *slope
,
double 'intercept
) ;
void detrend_endpt
(
double *source
,
int n
,
double *dest,
double *slope
,
double 'intercept
) ;
/*
Main detrending routine
7
void detrend
(
double 'source
,
int
n
, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.