當前位置: 首頁>>代碼示例>>Java>>正文


Java RealMatrix.getColumnVector方法代碼示例

本文整理匯總了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);
}
 
開發者ID:zavtech,項目名稱:morpheus-core,代碼行數:23,代碼來源:XDataFrameLeastSquares.java


注:本文中的org.apache.commons.math3.linear.RealMatrix.getColumnVector方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。