Example #1
0
        public void ValidateDensity(double mu, double sigma, double x, double p)
        {
            var n = new LogNormal(mu, sigma);

            AssertHelpers.AlmostEqual(p, n.Density(x), 14);
            AssertHelpers.AlmostEqual(p, LogNormal.PDF(mu, sigma, x), 14);
        }
Example #2
0
        public double density(
            double tStart, double tEnd,
            double stateStart, double stateEnd)
        {
            double mean  = (Mu - 0.5 * Sigma * Sigma) * (tEnd - tStart);
            double sigma = Sigma * Math.Sqrt(tEnd - tStart);

            return(LogNormal.PDF(mean, sigma, stateEnd / stateStart));
        }