本文整理匯總了Java中org.apache.commons.math3.linear.RealMatrix.getColumnVector方法的典型用法代碼示例。如果您正苦於以下問題:Java RealMatrix.getColumnVector方法的具體用法?Java RealMatrix.getColumnVector怎麽用?Java RealMatrix.getColumnVector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.math3.linear.RealMatrix
的用法示例。
在下文中一共展示了RealMatrix.getColumnVector方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: compute
import org.apache.commons.math3.linear.RealMatrix; //導入方法依賴的package包/類
/**
* Runs the regression model for the given dependent and independent variables
* The Y and X variables must be transformed, if necessary, to meet Gauss Markov assumptions
* @param y the dependent variable, which may be a transformed version of the raw data
* @param x the independent variable(s), which may be a transformed version of the raw data
*/
protected void compute(RealVector y, RealMatrix x) {
final int n = frame.rows().count();
final int p = regressors.size() + (hasIntercept() ? 1 : 0);
final int dfModel = regressors.size();
final RealMatrix betaMatrix = computeBeta(y, x);
final RealVector betaCoefficients = betaMatrix.getColumnVector(0);
final RealVector betaVariance = betaMatrix.getColumnVector(1);
this.tss = computeTSS(y);
this.ess = tss - rss;
this.fValue = (ess / dfModel) / (rss / (n - p));
this.fValueProbability = 1d - new FDistribution(dfModel, n-p).cumulativeProbability(fValue);
this.rSquared = 1d - (rss / tss);
this.rSquaredAdj = 1d - (rss * (n - (hasIntercept() ? 1 : 0))) / (tss * (n - p));
this.computeParameterStdErrors(betaVariance);
this.computeParameterSignificance(betaCoefficients);
}