60 for (i = 0; i < count; i++) {
61 for (j = i; j < count; j++) {
62 double sum = covar[i][j];
64 for (k = i - 1; k >= 0; k--)
77 for (i = 0; i < count; i++) {
78 double sum = covar_y[i + 1];
80 for (k = i - 1; k >= 0; k--)
86 for (j = count - 1; j >= min_order; j--) {
87 for (i = j; i >= 0; i--) {
88 double sum = m->
coeff[0][i];
90 for (k = i + 1; k <= j; k++)
98 for (i = 0; i <= j; i++) {
99 double sum = m->
coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1];
101 for (k = 0; k < i; k++)
102 sum += 2 * m->
coeff[j][k] * covar[k][i];
114 for (i = 0; i <= order; i++)
115 out += param[i] * m->
coeff[order][i];
120 #if FF_API_LLS_PRIVATE
154 for (i = 0; i < 100; i++) {
158 var[0] = (
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2;
159 var[1] = var[0] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
160 var[2] = var[1] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
161 var[3] = var[2] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
164 for (order = 0; order < 3; order++) {
166 printf(
"real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n",
167 var[0], order, eval, sqrt(m.
variance[order] / (i + 1)),