Esempio n. 1
0
        /// <summary>
        /// Sets this SparseGP distribution to the weighted sum of two other such distributions
        /// </summary>
        /// <param name="weight1"></param>
        /// <param name="value1"></param>
        /// <param name="weight2"></param>
        /// <param name="value2"></param>
        /// <remarks>Not yet implemented</remarks>
        public void SetToSum(double weight1, SparseGP value1, double weight2, SparseGP value2)
        {
            if (value1.FixedParameters != value2.FixedParameters)
            {
                throw new ArgumentException("SparseGPs do not have the same FixedParameters.  a.FixedParameters = " + value1.FixedParameters + ", b.FixedParameters = " +
                                            value2.FixedParameters);
            }
            FixedParameters = value1.FixedParameters;
            if (value1.IncludePrior != value2.IncludePrior)
            {
                throw new ArgumentException("One Sparse GP includes a prior, the other does not.  Cannot add.");
            }
            IncludePrior = value1.IncludePrior;

            InducingDist.SetToSum(weight1, value1.InducingDist, weight2, value2.InducingDist);
            // The only time the result is a point mass is if both sources are the same point mass
            if (InducingDist.IsPointMass)
            {
                pointFunc = value1.pointFunc;
            }
            else
            {
                pointFunc = null;
            }
            ClearCachedValues();
        }