NAG CL Interface
g10cac computes a smoothed data sequence using running median smoothers.
The function may be called by the names: g10cac, nag_smooth_data_runningmedian or nag_running_median_smoother.
Given a sequence of observations recorded at equally spaced intervals, g10cac fits a smooth curve through the data using one of two smoothers. They are based on the use of running medians and averages to summarise the overlapping segments. The fit is called the smooth, the residuals the rough and they obey the following:
Data = Smooth + Rough
The two smoothers are :
1.4253H, twice consisting of a running median of , then , then , then 3 followed by Hanning. Hanning is a running weighted average, the weights being 1/4, 1/2 and 1/4. The result of this smoothing is then reroughed by computing residuals, applying the same smoother to them and adding the result to the smooth of the first pass.
2.3RSSH, twice consisting of a running median of , two splitting operations named S to improve the smooth sequence, each of which is followed by a running median of , and finally Hanning. The end points are dealt with using the method described by Velleman and Hoaglin (1981). The full smoother 3RSSH, twice is produced by reroughing as described above.
The compound smoother 4253H, twice is recommended. The smoother 3RSSH, twice is popular when calculating by hand as it requires simpler computations and is included for comparison purposes.
Tukey J W (1977) Exploratory Data Analysis Addison–Wesley
Velleman P F and Hoaglin D C (1981) Applications, Basics, and Computing of Exploratory Data Analysis Duxbury Press, Boston, MA
must specify the method to be used.
- 4253H, twice is used.
- 3RSSH, twice is used.
On entry: the number, , of the observations.
If then the sequence is not long enough to carry out smoothing.
– const double
On entry: the sample observations.
On exit: contains the smooth.
On exit: contains the rough.
– NagError *
The NAG error argument (see Section 7
in the Introduction to the NAG Library CL Interface).
Error Indicators and Warnings
On entry, argument smoother
had an illegal value.
On entry, .
Parallelism and Performance
g10cac is not threaded in any implementation.
Internal changes have been made to this function as follows:
- At Mark 25: g10cac is a
smoothing function with two possible smoothing methods. The
function was previously using the incorrect method (i.e., if you asked for method A you would get method B, and vice versa).
For details of all known issues which have been reported for the NAG Library please refer to the Known Issues
The example program reads in a sequence of 49 data taken from Tukey (1977)
, above. Results are obtained using the two smoothing methods described.