59 for (i = 0; i < count; i++) {
60 for (j = i; j < count; j++) {
61 double sum = covar[i][j];
63 for (k = i - 1; k >= 0; k--)
76 for (i = 0; i < count; i++) {
77 double sum = covar_y[i + 1];
79 for (k = i - 1; k >= 0; k--)
85 for (j = count - 1; j >= min_order; j--) {
86 for (i = j; i >= 0; i--) {
87 double sum = m->
coeff[0][i];
89 for (k = i + 1; k <= j; k++)
97 for (i = 0; i <= j; i++) {
98 double sum = m->
coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1];
100 for (k = 0; k < i; k++)
101 sum += 2 * m->
coeff[j][k] * covar[k][i];
113 for (i = 0; i <= order; i++)
114 out += param[i] * m->
coeff[order][i];
134 for (i = 0; i < 100; i++) {
138 var[0] = (
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2;
139 var[1] = var[0] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
140 var[2] = var[1] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
141 var[3] = var[2] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
144 for (order = 0; order < 3; order++) {
146 printf(
"real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n",
147 var[0], order, eval, sqrt(m.
variance[order] / (i + 1)),