本文整理汇总了Java中cc.mallet.util.StatFunctions.pt方法的典型用法代码示例。如果您正苦于以下问题:Java StatFunctions.pt方法的具体用法?Java StatFunctions.pt怎么用?Java StatFunctions.pt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cc.mallet.util.StatFunctions
的用法示例。
在下文中一共展示了StatFunctions.pt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pValues
import cc.mallet.util.StatFunctions; //导入方法依赖的package包/类
public double[] pValues() {
double[] values = new double[dimension];
for (int index=0; index < dimension; index++) {
double standardError = Math.sqrt(meanSquaredError *
xTransposeXInverse[(dimension * index) + index]);
values[index] = 2 * (1.0 - StatFunctions.pt(Math.abs(parameters[index] / standardError),
degreesOfFreedom));
}
return values;
}
示例2: printSummary
import cc.mallet.util.StatFunctions; //导入方法依赖的package包/类
/** Print a summary of the regression, similar to summary(lm(...)) in R */
public void printSummary() {
double standardError, tPercentile;
System.out.println("\tparam\tStd.Err\tt value\tPr(>|t|)");
System.out.print("(Int)\t");
System.out.print(formatter.format(parameters[interceptIndex]) + "\t");
standardError =
Math.sqrt(meanSquaredError *
xTransposeXInverse[(dimension * interceptIndex) + interceptIndex]);
System.out.print(formatter.format(standardError) + "\t");
System.out.print(formatter.format(parameters[interceptIndex] / standardError) + "\t");
tPercentile =
2 * (1.0 - StatFunctions.pt(Math.abs(parameters[interceptIndex] / standardError),
degreesOfFreedom));
System.out.println(formatter.format(tPercentile) + " " +
significanceStars(tPercentile));
for (int index=0; index < dimension - 1; index++) {
System.out.print(trainingData.getDataAlphabet().lookupObject(index) + "\t");
System.out.print(formatter.format(parameters[index]) + "\t");
standardError =
Math.sqrt(meanSquaredError *
xTransposeXInverse[(dimension * index) + index]);
System.out.print(formatter.format(standardError) + "\t");
System.out.print(formatter.format(parameters[index] / standardError) + "\t");
tPercentile =
2 * (1.0 - StatFunctions.pt(Math.abs(parameters[index] / standardError),
degreesOfFreedom));
System.out.println(formatter.format(tPercentile) + " " +
significanceStars(tPercentile));
}
System.out.println();
System.out.println("SSE: " + formatter.format(sumSquaredError) +
" DF: " + degreesOfFreedom);
System.out.println("R^2: " +
formatter.format(sumSquaredModel / (sumSquaredError + sumSquaredModel)));
}