1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-06-22 00:42:02 +01:00

normalised residuals routines

This commit is contained in:
2021-12-20 01:30:03 +01:00
parent 24a7b9c203
commit adf2c9cc69
4 changed files with 43 additions and 0 deletions

View File

@ -346,6 +346,29 @@ XYSampleData XYSampleData::getResiduals(const SampleFitResult &fit)
return res;
}
XYSampleData XYSampleData::getNormalisedResiduals(const SampleFitResult &fit)
{
XYSampleData res(*this);
for (Index j = 0; j < getNYDim(); ++j)
{
const DoubleFunctionSample &f = fit.getModel(_, j);
for (auto &p: yData_[j])
{
res.y(p.first, j) -= f(x(p.first));
}
const DMat &var = res.getYYVar(j, j);
for (auto &p: yData_[j])
{
res.y(p.first, j) /= sqrt(var(p.first, p.first));
}
}
return res;
}
XYSampleData XYSampleData::getPartialResiduals(const SampleFitResult &fit,
const DVec &ref, const Index i)
{