示例#1
0
文件: Restore.cs 项目: jokert1/Xbox
        public static double dov_exp(List <double> X, double sum, double x)
        {
            double D      = 0;
            double N      = sum;
            double lamda  = 1 / PointMark.Ave(X);
            double nk     = Quantil.NormalQuantil();
            double D_lyam = Math.Pow(lamda, 2) / N;

            D = nk * Math.Sqrt(Math.Pow(x, 2) * Math.Exp(-2 * lamda * x) * D_lyam);
            return(D);
        }
示例#2
0
文件: Form1.cs 项目: jokert1/Xbox
        private void експоненціальнийToolStripMenuItem_Click(object sender, EventArgs e)
        {
            X.Sort();
            chart1.Series.Add("exp");
            chart1.Series["exp"].Color       = Color.Violet;
            chart1.Series["exp"].ChartType   = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            chart1.Series["exp"].BorderWidth = 1;
            chart1.Series["exp"].BorderColor = Color.Black;
            double D = 0;

            for (double i = X[0]; i < X.Max(); i += 0.01 * (X.Max() - X.Min()))
            {
                chart1.Series["exp"].Points.AddXY(i, Restore.fExp(X, i) * step);
            }

            chart2.Series.Add("exp");
            chart2.Series.Add("exp+");
            chart2.Series["exp+"].Color       = Color.Pink;
            chart2.Series["exp+"].ChartType   = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            chart2.Series["exp+"].BorderWidth = 1;
            chart2.Series["exp+"].BorderColor = Color.Pink;
            chart2.Series.Add("exp-");
            chart2.Series["exp-"].Color       = Color.Violet;
            chart2.Series["exp-"].ChartType   = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            chart2.Series["exp-"].BorderWidth = 1;
            chart2.Series["exp-"].BorderColor = Color.Violet;
            chart2.Series["exp"].Color        = Color.DarkBlue;
            chart2.Series["exp"].ChartType    = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            chart2.Series["exp"].BorderWidth  = 1;
            chart2.Series["exp"].BorderColor  = Color.Black;
            double lyambda = 1 / PointMark.Ave(X);
            double nk      = Quantil.NormalQuantil();
            double D_lyam  = Math.Pow(lyambda, 2) / sum;

            for (double i = X[0]; i < X.Max(); i += 0.01 * (X.Max() - X.Min()))
            {
                D = Math.Pow(i, 2) * Math.Exp(-2 * lyambda * i) * (Math.Pow(lyambda, 2) / sum);
                chart2.Series["exp+"].Points.AddXY(i, Restore.FExp(X, i) + Quantil.StudentQuantil(sum, X) * Math.Sqrt(D));
                chart2.Series["exp"].Points.AddXY(i, Restore.FExp(X, i));
                chart2.Series["exp+"].Points.AddXY(i, Restore.FExp(X, i) - Quantil.StudentQuantil(sum, X) * Math.Sqrt(D));
            }
        }