当前位置: 首页>>代码示例>>Java>>正文


Java McLeanRegressionLineInterface类代码示例

本文整理汇总了Java中org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface的典型用法代码示例。如果您正苦于以下问题:Java McLeanRegressionLineInterface类的具体用法?Java McLeanRegressionLineInterface怎么用?Java McLeanRegressionLineInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


McLeanRegressionLineInterface类属于org.cirdles.mcLeanRegression.core包,在下文中一共展示了McLeanRegressionLineInterface类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fitLineToDataFor2D

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
@Override
public McLeanRegressionLineInterface fitLineToDataFor2D(double[] x, double[] y, double[] x1SigmaAbs, double[] y1SigmaAbs, double[] rhos) {
    int rowCount = x.length;
    Matrix data = new Matrix(rowCount, 2);
    data.setMatrix(0, rowCount - 1, 0, 0, new Matrix(x, rowCount));
    data.setMatrix(0, rowCount - 1, 1, 1, new Matrix(y, rowCount));
    
    Matrix unct = new Matrix(rowCount, 3);
    unct.setMatrix(0, rowCount - 1, 0, 0, new Matrix(x1SigmaAbs, rowCount));
    unct.setMatrix(0, rowCount - 1, 1, 1, new Matrix(y1SigmaAbs, rowCount));
    unct.setMatrix(0, rowCount - 1, 2, 2, new Matrix(rhos, rowCount));
    
    McLeanRegressionLineFitEngineInterface mcLeanRegressionLineFitEngine = new McLeanRegressionLineFitEngine(data, unct);
    McLeanRegressionLineInterface fitLine = mcLeanRegressionLineFitEngine.fitLine();

    return fitLine;
}
 
开发者ID:CIRDLES,项目名称:McLeanRegression,代码行数:18,代码来源:McLeanRegression.java

示例2: fitLineToDataFor2D

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
public McLeanRegressionLineInterface fitLineToDataFor2D(String x, String y, String x1SigmaAbs, String y1SigmaAbs, String rhos) {
    double[] xDouble = toDouble(x);
    double[] yDouble = toDouble(y);
    double[] x1SigmaAbsDouble = toDouble(x1SigmaAbs);
    double[] y1SigmaAbsDouble = toDouble(y1SigmaAbs);
    double[] rhosDouble = toDouble(rhos);

    double[][] xy = new double[x.length()][2];

    for(int i = 0; i < xDouble.length; i++) {
        xy[i][0] = xDouble[i];
        xy[i][1] = yDouble[i];
    }

    try {
        mcLeanRegressionLine = mcLeanRegression.fitLineToDataFor2D(xDouble, yDouble, x1SigmaAbsDouble, y1SigmaAbsDouble, rhosDouble);
    } catch (Exception e) {
        // in the case that an uncertainty is not provided, the try block fails and we do an ordinary least squares (OLS)
        SimpleRegression regression = new SimpleRegression();
        regression.addData(xy);

        mcLeanRegressionLine = new McLeanOrdinaryLeastSquaresRegressionLine(regression);
    }

    return mcLeanRegressionLine;
}
 
开发者ID:CIRDLES,项目名称:Topsoil,代码行数:27,代码来源:Regression.java

示例3: fitLineToDataFor2or3or4or5DFromCSV

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
/**
 *
 * @param myDataFilePath
 * @return McLeanRegressionLineInterface fitLine
 * @throws IOException
 */
@Override
public McLeanRegressionLineInterface fitLineToDataFor2or3or4or5DFromCSV(String myDataFilePath)
        throws IOException {

    String dataFilePath = myDataFilePath;
    DataFileHandlerInterface dataPrep = new DataFileHandler();
    McLeanRegressionLineFitEngineInterface mcLeanRegressionLineFitEngine = dataPrep.extractDataAndUnctMatricesFromCsvFile(dataFilePath);

    McLeanRegressionLineInterface fitLine = mcLeanRegressionLineFitEngine.fitLine();

    return fitLine;
}
 
开发者ID:CIRDLES,项目名称:McLeanRegression,代码行数:19,代码来源:McLeanRegression.java

示例4: producePlots

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
/**
 * Plots the first variable ("x") against each of the remaining dimension variables.
 * @param lineFitEngine
 * @param lineFitParameters
 * @throws IOException
 */
public void producePlots(
        McLeanRegressionLineFitEngineInterface lineFitEngine, McLeanRegressionLineInterface lineFitParameters)
        throws IOException {

    int dimCount = lineFitParameters.getA().length;

    Matrix x = lineFitEngine.getData().getMatrix(0, lineFitParameters.getN() - 1, 0, 0);
    Matrix xUnct = lineFitEngine.getUnct().getMatrix(0, lineFitParameters.getN() - 1, 0, 0);

    TopsoilPlotter [] plots = new TopsoilPlotter[dimCount - 1];

    for (int dim = 1; dim < dimCount; dim++) {
        Matrix y = lineFitEngine.getData().getMatrix(0, lineFitParameters.getN() - 1, dim, dim);
        Matrix yUnct = lineFitEngine.getUnct().getMatrix(0, lineFitParameters.getN() - 1, dim, dim);
        Matrix rho = lineFitEngine.getUnct().getMatrix(0, lineFitParameters.getN() - 1, dimCount + dim - 1, dimCount + dim - 1);

        Matrix data = new Matrix(lineFitParameters.getN(), 2);
        Matrix unct = new Matrix(lineFitParameters.getN(), 3);

        data.setMatrix(0, lineFitParameters.getN() - 1, 0, 0, x);
        data.setMatrix(0, lineFitParameters.getN() - 1, 1, 1, y);

        unct.setMatrix(0, lineFitParameters.getN() - 1, 0, 0, xUnct);
        unct.setMatrix(0, lineFitParameters.getN() - 1, 1, 1, yUnct);
        unct.setMatrix(0, lineFitParameters.getN() - 1, 2, 2, rho);

        plots[dim] = new TopsoilPlotter(data.getArrayCopy(), unct.getArrayCopy());

    }
}
 
开发者ID:CIRDLES,项目名称:McLeanRegression,代码行数:37,代码来源:Plot.java

示例5: writeReportsFromDataFile

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
public void writeReportsFromDataFile(String dataFileLocation)
        throws IOException {
    McLeanRegressionLineFitEngineInterface lineFitEngine = extractDataAndUnctMatricesFromCsvFile(dataFileLocation);
    McLeanRegressionLineInterface lineFitParameters = lineFitEngine.fitLine();
    reportsEngine.produceReports(lineFitParameters);
    
    //reportsEngine.producePlots(lineFitEngine, lineFitParameters);
}
 
开发者ID:CIRDLES,项目名称:McLeanRegression,代码行数:9,代码来源:DataFileHandler.java

示例6: fitLineToDataFor2or3or4or5DFromCSV

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
public McLeanRegressionLineInterface fitLineToDataFor2or3or4or5DFromCSV(String myDataFilePath)
throws IOException;
 
开发者ID:CIRDLES,项目名称:McLeanRegression,代码行数:3,代码来源:McLeanRegressionInterface.java

示例7: getMcLeanRegressionLine

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
/**
 * @return the mcLeanRegressionLine
 */
public McLeanRegressionLineInterface getMcLeanRegressionLine() {
    return mcLeanRegressionLine;
}
 
开发者ID:CIRDLES,项目名称:ET_Redux,代码行数:7,代码来源:SampleDateModel.java

示例8: setMcLeanRegressionLine

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
/**
 * @param mcLeanRegressionLine the mcLeanRegressionLine to set
 */
public void setMcLeanRegressionLine(McLeanRegressionLineInterface mcLeanRegressionLine) {
    this.mcLeanRegressionLine = mcLeanRegressionLine;
}
 
开发者ID:CIRDLES,项目名称:ET_Redux,代码行数:7,代码来源:SampleDateModel.java

示例9: fitLineToDataFor2D

import org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface; //导入依赖的package包/类
public McLeanRegressionLineInterface fitLineToDataFor2D(double[] x, double[] y, double[] x1SigmaAbs, double[] y1SigmaAbs, double[] rhos) ; 
开发者ID:CIRDLES,项目名称:McLeanRegression,代码行数:2,代码来源:McLeanRegressionInterface.java


注:本文中的org.cirdles.mcLeanRegression.core.McLeanRegressionLineInterface类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。