public ci getConfidenceInterval(double alpha) { double a = Accord.Math.Normal.Inverse(1 - (alpha / 2)) * STE; double u = Kappa + a; double l = Kappa - a; ci CI = new ci(); CI.UpperBound = u; CI.LowerBound = l; return(CI); }
public ci[] getConfidenceIntervalues(double alpha) { double zScore = Accord.Math.Normal.Inverse(1 - alpha / 2); int rLen = StandardError.Length; ci[] outCi = new ci[rLen]; int aLen = StandardError.Length; for (int j = 0; j < aLen; j++) { double vl = StandardError[j] * zScore; double beta = Coefficients[j]; double lbeta = beta - vl; double ubeta = beta + vl; ci oci = new ci(); oci.LowerBound = lbeta; oci.UpperBound = ubeta; outCi[j] = oci; } return(outCi); }
public void getReport(double alpha) { if (gConf == null) { buildModel(); } Forms.RunningProcess.frmRunningProcessDialog rd = new Forms.RunningProcess.frmRunningProcessDialog(false); rd.Text = "Accuracy Assessment"; rd.TopLevel = true; rd.pgbProcess.Visible = false; rd.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; string[] hd = new string[labels.Count]; for (int i = 0; i < hd.Length; i++) { string s = labels[i]; if (s.Length > 4) { hd[i] = s.Substring(0, 4); } else { hd[i] = s.PadRight(3); } } rd.addMessage(" " + String.Join(" ", hd)); rd.addMessage("------".PadRight((labels.Count + 1) * 7, '-')); for (int i = 0; i < labels.Count; i++) { string[] lnArr = new string[labels.Count + 1]; string vl = labels[i]; if (vl.Length > 4) { vl = vl.Substring(0, 4); } else { vl = vl.PadRight(4); } lnArr[0] = vl; for (int j = 0; j < labels.Count; j++) { vl = xtable[i, j].ToString(); if (vl.Length < 4) { vl = vl.PadRight(4); } lnArr[j + 1] = vl; } rd.addMessage(String.Join(" | ", lnArr) + "|"); rd.addMessage("------".PadRight((labels.Count + 1) * 7, '-')); } Accord.Statistics.Testing.ChiSquareTest ct = new Accord.Statistics.Testing.ChiSquareTest(ChiSquare, System.Convert.ToInt32(Math.Pow(labels.Count - 1, 2))); rd.addMessage("Chi-square = " + ChiSquare + " DF = " + ct.DegreesOfFreedom.ToString() + " p-value = " + ct.PValue.ToString()); rd.addMessage("Overall = " + Overall.ToString()); rd.addMessage("Kappa = " + Kappa.ToString()); rd.addMessage("STE = " + STE.ToString()); ci conf = getConfidenceInterval(alpha); rd.addMessage("Kappa CI = " + conf.LowerBound.ToString() + " - " + conf.UpperBound.ToString()); rd.addMessage("Cohen Kappa Variance = " + CohenKappaVariance.ToString()); rd.Show(); rd.enableClose(); }
public ci getConfidenceInterval(double alpha) { double a = Accord.Math.Normal.Inverse(1 - (alpha / 2)) * STE; double u = Kappa + a; double l = Kappa - a; ci CI = new ci(); CI.UpperBound = u; CI.LowerBound = l; return CI; }
public ci[][] getConfidenceIntervalues(double alpha) { double zScore = Accord.Math.Normal.Inverse(1 - alpha / 2); int rLen = StandardError.Length; ci[][] outCi = new ci[rLen][]; int aLen = StandardError[0].Length; for (int i = 0; i < rLen; i++) { for (int j = 0; j < aLen; j++) { double vl = StandardError[i][j] * zScore; double beta = Coefficients[i][j]; double lbeta = beta - vl; double ubeta = beta + vl; ci oci = new ci(); oci.LowerBound=lbeta; oci.UpperBound=ubeta; outCi[i][j] = oci; } } return outCi; }