Changeset 3080 in ntrip for trunk/BNC/combination


Ignore:
Timestamp:
Mar 6, 2011, 8:53:47 PM (14 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/combination/bnccomb.cpp

    r3079 r3080  
    628628    }
    629629
     630    const double MAXRES = 0.10;  // TODO: make it an option
     631
    630632    ColumnVector dx;
    631     bncModel::kalman(AA, ll, PP, _QQ, dx);
    632     ColumnVector vv = ll - AA * dx;
    633     int    maxResIndex = 0;
    634     double maxRes      = vv.maximum_absolute_value1(maxResIndex);   
    635     out.setRealNumberNotation(QTextStream::FixedNotation);
    636     out.setRealNumberPrecision(3);
    637     out << "Maximum Residuum " << maxRes << " (index " << maxResIndex << ")\n";
     633    SymmetricMatrix QQ_sav = _QQ;
     634
     635    for (int ii = 1; ii < 10; ii++) {
     636      bncModel::kalman(AA, ll, PP, _QQ, dx);
     637      ColumnVector vv = ll - AA * dx;
     638
     639      int    maxResIndex;
     640      double maxRes = vv.maximum_absolute_value1(maxResIndex);   
     641      out.setRealNumberNotation(QTextStream::FixedNotation);
     642      out.setRealNumberPrecision(3); 
     643      out << "Maximum Residuum " << maxRes << " (index " << maxResIndex << ")\n";
     644
     645      if (maxRes > MAXRES) {
     646        out << "Outlier Detected" << endl;
     647        _QQ = QQ_sav;
     648        AA.Row(maxResIndex) = 0.0;
     649        ll.Row(maxResIndex) = 0.0;
     650      }
     651      else {
     652        break;
     653      }
     654    }
    638655
    639656    for (int iPar = 1; iPar <= _params.size(); iPar++) {
Note: See TracChangeset for help on using the changeset viewer.