# Changeset 7809

Ignore:
Timestamp:
11/18/11 09:07:43 (8 years ago)
Message:

Better comments on why the convolution is actually correct.
Fixed one possible crash point if there are no params to fit, now just returns the fitted fn with params provided.

File:
1 edited

Unmodified
Removed
• ## trunk/projects/slim-curve/src/main/c/EcfSingle.c

 r7803 if (paramfree[j]) mfit++; if (GCI_marquardt_compute_fn(x, y, ndata, noise, sig, param, paramfree, nparam, fitfunc, } /* Matrix solution; GCI_gauss_jordan solves Ax=b rather than AX=B */ if (GCI_solve(covar, *pmfit, dparam) != 0) return -1; if (*pmfit>0) { /* Matrix solution; GCI_gauss_jordan solves Ax=b rather than AX=B */ if (GCI_solve(covar, *pmfit, dparam) != 0) return -1; } else *alambda = 0; /* Once converged, evaluate covariance matrix */ /* We wish to find yfit = (*pfnvals) * instr, so explicitly: yfit[i] = sum_{j=0}^i (*pfnvals)[i-j].instr[j] But instr[k]=0 for k >= ninstr, so we only need to sum: But instr[k]=0 for k >= ninstr, AND (*pfnvals)[i]=0 for i<0 so we only need to sum: yfit[i] = sum_{j=0}^{min(ninstr-1,i)} (*pfnvals)[i-j].instr[j] for (k=1; k= ninstr, so we only need to sum: But instr[k]=0 for k >= ninstr, AND (*pfnvals)[i]=0 for i<0 so we only need to sum: yfit[i] = sum_{j=0}^{min(ninstr-1,i)} fnvals[i-j].instr[j]
Note: See TracChangeset for help on using the changeset viewer.