示例#1
0
        /// <summary>
        /// Evaluates the kernel of a point against the basis
        /// </summary>
        /// <param name="x">Input</param>
        /// <returns>Kernel values</returns>
        public Vector KernelOf_X_B(Vector x)
        {
            int            numBasis = NumberBasisPoints;
            Vector         result   = Vector.Zero(numBasis);
            IList <Vector> b        = Basis;

            for (int i = 0; i < numBasis; i++)
            {
                result[i] = Prior.Covariance(x, b[i]);
            }
            return(result);
        }
示例#2
0
        /// <summary>
        /// Evaluates the kernel of a list of points against the basis
        /// </summary>
        /// <param name="XList">List of inputs</param>
        /// <returns>Kernel values</returns>
        public Matrix KernelOf_X_B(IList <Vector> XList)
        {
            int    numPoints = XList.Count;
            int    numBasis  = Basis.Count;
            Matrix kXB       = new Matrix(numPoints, numBasis);

            for (int i = 0; i < numPoints; i++)
            {
                for (int j = 0; j < numBasis; j++)
                {
                    kXB[i, j] = Prior.Covariance(XList[i], Basis[j]);
                }
            }
            return(kXB);
        }