summaryrefslogtreecommitdiffstats
path: root/test/std_error.c
blob: 1bc050e11db101b50ffd7c9b3e079df234cd5c30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <math.h>
#include <stddef.h>
#include "ts.h"

bool ts_test_std_error( void )
{
    fp_t const x[] = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
    fp_t const * const inp[1] = { x };

    /* k=3, SD=sqrt(2/3)=0.81650 for all windows */
    /* StdError = SD/sqrt(3) = 0.81650/1.73205 = 0.47140 */
    fp_t const e[] = { 0.47140, 0.47140, 0.47140, 0.47140, 0.47140, 0.47140, 0.47140, 0.47140 };
    fp_t const * const exp[1] = { e };

    uint_t k = 3;
    return ts_test(ts_std_error, ts_std_error_offset, inp, exp, sizeof( x ) / sizeof( *x ), (ts_constant_t *)&k, &ts_std_error_p);
}