Ejemplo n.º 1
0
        protected override Vector Process(Vector v, DenseVector xMean = null, DenseVector xScale = null)
        {
            var idx = new DenseVector(this.M);

            for (int i = 0; i < this.M; i++)
            {
                idx[i] = i - (this.M - 1) / 2;
            }

            var s = Matlab.Flip(Matlab.Vander(idx));
            var S = s.SubMatrix(0, s.RowCount, 0, this.K + 1);

            var D1 = S.Transpose() * S;
            var D2 = D1.Inverse();
            var D  = D2 * S.Transpose();

            var mm  = (this.M + 1) / 2;
            var mmm = (this.M - 1) / 2;

            var pp = 1;

            for (int i = 1; i < this.P + 1; i++)
            {
                pp = pp * i;
            }

            var d = new DenseVector(v.Count);

            for (int i = mm; i < v.Count - mmm + 1; i++)
            {
                var xx = v.SubVector(i - mmm - 1, 2 * mmm + 1);
                var A  = D * xx;
                d[i - 1] = A[this.P] * pp;
            }
            return(d);
        }