using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.AnalysisServices.AdomdServer;
namespace DMExt
{
    public class DMExt
    {
        [SafeToPrepare(true)]
        public double GetProbabilityDistribution(double actual,
            double predicted, double variance)
        {
            if (Context.ExecuteForPrepare)
                return 0;
            return Math.Exp(-Math.Pow((actual - predicted), 2)
                / (2 * variance));
        }
    }
}
