Loading

mapper.kernel.cosine

mapper

This function pushes onto the stack a kernel smoothing mapper using a [cosine kernel](https://en.wikipedia.org/wiki/Kernel_(statistics)#In_non-parametric_statistics. The mapper applies the Nadaraya-Watson kernel-weighted average algorithm.

mapper.kernel.cosine is available since version 1.0.0.

See also

Signature

Examples

NEWGTS 'random walk' RENAME 0.0 'i' STORE 1 1000 <% NaN NaN NaN $i RAND 0.5 - + DUP 'i' STORE ADDVALUE %> FOR DUP // Pseudo radius of the kernel (the kernel really has a diameter of 2 * radius + 1 steps) 8 'radius' STORE // Number of time units per radius unit 1 'step' STORE [ SWAP $step $radius 2 * 1 + mapper.kernel.cosine $radius $radius 0 ] MAP 0 GET '%2B:smoothed' RENAME