Example #1
0
        private void Button3_Click(object sender, EventArgs e)
        {
            if (!ValueChecker.IsValid(exMTextBox.Text) || !ValueChecker.IsValid(exCoefficientATextBox.Text) || !ValueChecker.IsValid(exR0TextBox.Text))
            {
                MessageBox.Show("All the values should be positive integers!");
            }

            int m            = Convert.ToInt32(exMTextBox.Text);
            int coefficientA = Convert.ToInt32(exCoefficientATextBox.Text);
            int R0           = Convert.ToInt32(exR0TextBox.Text);

            Generator     generator = new Generator(coefficientA, m, R0);
            List <double> sequence  = new List <double>();

            double λ = double.Parse(exλTextBox.Text);

            sequence = Distribution.Exponential(generator.GetNext().Take(N), λ);

            CalculateExponentialDistributionEstimates(λ);
        }
        private void Button5_Click(object sender, EventArgs e)
        {
            if (!ValueChecker.IsValid(trMTextBox.Text) || !ValueChecker.IsValid(trCoefficientATextBox.Text) || !ValueChecker.IsValid(trR0TextBox.Text))
            {
                MessageBox.Show("All the values should be positive integers!");
            }

            int m            = Convert.ToInt32(trMTextBox.Text);
            int coefficientA = Convert.ToInt32(trCoefficientATextBox.Text);
            int R0           = Convert.ToInt32(trR0TextBox.Text);

            Generator     generator = new Generator(coefficientA, m, R0);
            List <double> sequence  = new List <double>();

            double a = double.Parse(trATextBox.Text);
            double b = double.Parse(trBTextBox.Text);

            sequence = Distribution.Triangular(generator.GetNext().Take(N), a, b);

            CalculateTriangularDistributionEstimates(sequence, a, b);
        }