예제 #1
0
        protected override ConditionalGaussianDistributionParams GetPlainConditionalGaussianDistribution(BranchOrLeaf branchOrLeaf, OptimizationParameterList gaussianParameters)
        {
            double variance = gaussianParameters["Variance"].Value;
            //double alphaTimesVariance = gaussianParameters["AlphaVariance"].Value;
            double mean            = gaussianParameters["Mean"].Value;
            double alpha           = gaussianParameters["Alpha"].Value;
            double fOfBranchLength = FOfBranchLength(branchOrLeaf.Length, alpha);

            //ConditionalGaussianDistributionParams plainConditionalDistribution = ConditionalGaussianDistributionParams.GetInstance();
            //double root1MinusAlphaTimesBranchLength = Math.Sqrt(1 - alpha * branchOrLeaf.Length);
            double root1MinusFofBranchLength = Math.Sqrt(1 - FOfBranchLength(branchOrLeaf.Length, alpha));

            // ax + b, Mean := b
            double meanForGaussDistParams = mean * (1.0 - root1MinusFofBranchLength);
            //double meanForGausDistParams = mean * (1.0 - root1MinusAlphaTimesBranchLength);
            // ax + b = x, LinearCoefficent := a
            double linearCoeffForGaussDistParams = root1MinusFofBranchLength;
            //double linearCoeffForGausDistParams = root1MinusAlphaTimesBranchLength;
            //double varForGausDistParams = alphaTimesVariance * branchOrLeaf.Length;
            double varianceForGaussDistParams = fOfBranchLength * variance;

            ConditionalGaussianDistributionParams plainConditionalDistribution =
                ConditionalGaussianDistributionParams.GetInstance(meanForGaussDistParams, varianceForGaussDistParams, linearCoeffForGaussDistParams);

            return(plainConditionalDistribution);
        }
예제 #2
0
        protected override ConditionalGaussianDistributionParams GetPlainConditionalGaussianDistribution(BranchOrLeaf branchOrLeaf, OptimizationParameterList gaussianParameters)
        {
            double variance = gaussianParameters["Variance"].Value;

            ConditionalGaussianDistributionParams plainConditionalDistribution =
                ConditionalGaussianDistributionParams.GetInstance(0, variance, 1);

            return(plainConditionalDistribution);
        }
예제 #3
0
        protected override ConditionalGaussianDistributionParams GetPlainConditionalGaussianDistribution(BranchOrLeaf branchOrLeaf, OptimizationParameterList gaussianParameters)
        {
            // NOTE: For BM, interpret Alpha as AlphaTimesVariance. Alpha is only used to multiply against variance, and searching is easier we we do
            // it this way, as otherwise alphaTimesVariance is affected by both alpha and variance when we're searching.
            double alphaTimesVariance = gaussianParameters["Alpha"].Value;
            //double alpha = gaussianParameters["Alpha"].Value;
            //double variance = gaussianParameters["Variance"].Value;

            // 0 (const part of mean) ax + b, Mean := b
            double mean = 0;
            // 1 (ax + b = x), linearCoefficent := a.
            double linearCoefficient = 1;
            //double conditionalVariance = alpha * variance * branchOrLeaf.Length;
            double conditionalVariance = alphaTimesVariance * branchOrLeaf.Length;

            ConditionalGaussianDistributionParams plainConditionalDistribution =
                ConditionalGaussianDistributionParams.GetInstance(mean, conditionalVariance, linearCoefficient);

            return(plainConditionalDistribution);
        }
예제 #4
0
 internal ConditionalGaussianDistributionParams AddOffsetToMean(double delta)
 {
     return(ConditionalGaussianDistributionParams.GetInstance(Mean + delta, Variance, LinearCoefficient));
 }