public double GetQuantile()
 {
     return(Math.Round(correlationStat.GetQuantileStudent(0.975, listX.Count - 2), 4));
 }
Beispiel #2
0
        private void FillTextBoxesCorrelation()
        {
            var alpha          = 0.1;
            var normalQuantile = Math.Round(correlationStat.BuildNormalQuantile(1 - alpha / 2), 4);
            // pair correlation
            var pairCorrelation             = correlationStat.GetCoefPairCorrelation(firstLevelStat.GetAverage().Key, firstLevelStat.GetAverage().Value);
            var pairCorrelationStat         = correlationStat.GetStatisticForPairCorrelation(pairCorrelation);
            var pairCorrelationQuantile     = correlationStat.GetQuantileStudent(1 - alpha / 2, correlationStat.listModels.Count() - 2);
            var pairCorrelationSignificance = correlationStat.GetSignificanceForPairCorrelation(pairCorrelationStat, pairCorrelationQuantile);

            txtPairCorrelationValue.Text     = pairCorrelation.ToString();
            txtPairCorrelationStat.Text      = pairCorrelationStat.ToString();
            txtPairCorrelationQuantile.Text  = pairCorrelationQuantile.ToString();
            txtSignificance.Text             = pairCorrelationSignificance.ToString();
            txtLowLimitPairCorrelation.Text  = correlationStat.GetLowLimitForPairCorrelation(pairCorrelation, correlationStat.BuildNormalQuantile(1 - alpha / 2)).ToString();
            txtHighLimitPairCorrelation.Text = correlationStat.GetHighLimitForPairCorrelation(pairCorrelation, correlationStat.BuildNormalQuantile(1 - alpha / 2)).ToString();

            // correlation ratio
            var correlationRatio     = correlationStat.GetCorrelationRelation();
            var correlationRatioStat = correlationStat.GetStatisticCorrelationRatio(correlationRatio);
            var quantileFisher       = correlationStat.GetQuantileFisher(1 - alpha, 60 - 2, correlationStat.listModels.Count() - 60);

            txtCorrelationRatio.Text         = correlationRatio.ToString();
            txtCorrelationRatioStat.Text     = correlationRatioStat.ToString();
            txtCorrelationRatioQuantile.Text = quantileFisher.ToString();
            txtCorrelationRatioSign.Text     = correlationStat.GetSignificanceForCorrelationRatio(correlationRatioStat).ToString();

            // spirman coef
            txtSpiramnCoef.Text         = correlationStat.GetSpirmanCoef().ToString();
            txtSpirmanStat.Text         = correlationStat.GetSpirmanStat(correlationStat.GetSpirmanCoef()).ToString();
            txtSpirmanCoefQuantile.Text = pairCorrelationQuantile.ToString();
            txtSpirmanSign.Text         = correlationStat.GetSignificanceForSpirmanCoef(correlationStat.GetSpirmanStat(correlationStat.GetSpirmanCoef()), pairCorrelationQuantile).ToString();

            // kandela coef
            txtKandelaCoef.Text         = correlationStat.GetKandelaCoef().ToString();
            txtCandelaStat.Text         = correlationStat.GetCandelaStat(correlationStat.GetKandelaCoef()).ToString();
            txtCandelaSign.Text         = correlationStat.GetSignificanceForCandelaCoef(correlationStat.GetCandelaStat(correlationStat.GetKandelaCoef())).ToString();
            txtCandelaCoefQuantile.Text = normalQuantile.ToString();

            // linnear regression analyze
            var getLinearRegressionCoefA = regressionStatistic.GetLinearRegressionCoefs(pairCorrelation).A;
            var getLinearRegressionCoefB = regressionStatistic.GetLinearRegressionCoefs(pairCorrelation).B;

            txtLinearValueA.Text = getLinearRegressionCoefA.ToString();
            txtLinearValueB.Text = getLinearRegressionCoefB.ToString();
            var linearDispersionA = regressionStatistic.GetDespersionForA(getLinearRegressionCoefA, getLinearRegressionCoefB);
            var linearDispersionB = regressionStatistic.GetDespersionForB(getLinearRegressionCoefA, getLinearRegressionCoefB);

            txtLinearDispersionA.Text = linearDispersionA.ToString();
            txtLinearDispersionB.Text = linearDispersionB.ToString();
            linearStatisticA.Text     = regressionStatistic.GetStatistic(getLinearRegressionCoefA, linearDispersionA).ToString();
            linearStatisticB.Text     = regressionStatistic.GetStatistic(getLinearRegressionCoefB, linearDispersionB).ToString();
            var quantile = regressionStatistic.GetQuantile();

            txtLinearQuantileA.Text     = quantile.ToString();
            txtLinearQuantileB.Text     = quantile.ToString();
            txtLinearSignificanceA.Text = regressionStatistic.GetSignificance(quantile, getLinearRegressionCoefA).ToString();
            txtLinearSignificanceB.Text = regressionStatistic.GetSignificance(quantile, getLinearRegressionCoefB).ToString();
            txtLinearLowLimitA.Text     = regressionStatistic.GetLowLimit(getLinearRegressionCoefA, quantile, linearDispersionA).ToString();
            txtLinearHighLimitA.Text    = regressionStatistic.GetHighLimit(getLinearRegressionCoefA, quantile, linearDispersionA).ToString();
            txtLinearLowLimitB.Text     = regressionStatistic.GetLowLimit(getLinearRegressionCoefB, quantile, linearDispersionB).ToString();
            txtLinearHighLimitB.Text    = regressionStatistic.GetHighLimit(getLinearRegressionCoefB, quantile, linearDispersionB).ToString();
        }