computeWeights method

  1. @override
void computeWeights()
override

Computes covariance and mean matrices

Implementation

@override
void computeWeights() {
  int newN = n;
  double lambda = pow(_alpha, 2) * (newN + _kappa) - newN;
  double c = 0.5 / (newN + lambda);
  List<double> wc = List.generate(2 * newN + 1, (index) => c);
  List<double> wm = List.generate(2 * newN + 1, (index) => c);
  wc[0] = lambda / (newN + lambda) + (1 - pow(_alpha, 2) + _beta);
  wm[0] = lambda / (newN + lambda);
  weightsCov = Matrix.fromList([wc]);
  weightsMean = Matrix.fromList([wm]);
}