64 for (j = i; j <
count; j++) {
65 double sum = covar[i][j];
67 for (k = i - 1; k >= 0; k--)
80 for (i = 0; i <
count; i++) {
81 double sum = covar_y[i + 1];
83 for (k = i - 1; k >= 0; k--)
89 for (j = count - 1; j >= min_order; j--) {
90 for (i = j; i >= 0; i--) {
91 double sum = m->
coeff[0][i];
93 for (k = i + 1; k <= j; k++)
101 for (i = 0; i <= j; i++) {
102 double sum = m->
coeff[j][i] * covar[i][i] - 2 * covar_y[i + 1];
104 for (k = 0; k < i; k++)
105 sum += 2 * m->
coeff[j][k] * covar[k][i];
117 for (i = 0; i <= order; i++)
118 out += param[i] * m->
coeff[order][i];
123 #if FF_API_LLS_PRIVATE
159 for (i = 0; i < 100; i++) {
163 var[0] = (
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5) * 2;
164 var[1] = var[0] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
165 var[2] = var[1] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
166 var[3] = var[2] +
av_lfg_get(&lfg) / (double) UINT_MAX - 0.5;
169 for (order = 0; order < 3; order++) {
171 printf(
"real:%9f order:%d pred:%9f var:%f coeffs:%f %9f %9f\n",
172 var[0], order, eval, sqrt(m.
variance[order] / (i + 1)),