55 for (j = i; j <
count; j++) {
56 double sum = covar[i][j];
58 for (k = i - 1; k >= 0; k--)
71 for (i = 0; i <
count; i++) {
72 double sum = covar_y[i + 1];
74 for (k = i - 1; k >= 0; k--)
80 for (j = count - 1; j >= min_order; j--) {
81 for (i = j; i >= 0; i--) {
82 double sum = m->
coeff[0][i];
84 for (k = i + 1; k <= j; k++)
92 for (i = 0; i <= j; i++) {
93 double sum = m->
coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1];
95 for (k = 0; k < i; k++)
96 sum += 2 * m->
coeff[j][k] * covar[k][i];
108 for (i = 0; i <= order; i++)
109 out += param[i] * m->
coeff[order][i];
139 for (i = 0; i < 100; i++) {
143 var[0] = (
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2;
144 var[1] = var[0] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
145 var[2] = var[1] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
146 var[3] = var[2] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
149 for (order = 0; order < 3; order++) {
151 printf(
"real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n",
152 var[0], order, eval, sqrt(m.
variance[order] / (i + 1)),