Search in sources :

Example 1 with Weights

use of cbit.vcell.opt.Weights in project vcell by virtualcell.

the class CurveFitting method solve.

// legacy method, which taks one explicit function to fit one reference data column (colIndex = 1, index 0 is time column)
// if weights is null, set the only one dependent variable weight is 1
public static OptimizationResultSet solve(Expression modelExp, Parameter[] parameters, double[] time, double[] data, Weights weights) throws ExpressionException, OptimizationException, IOException {
    // one fit function and data pair
    ExplicitFitObjectiveFunction.ExpressionDataPair[] expDataPairs = new ExplicitFitObjectiveFunction.ExpressionDataPair[1];
    expDataPairs[0] = new ExplicitFitObjectiveFunction.ExpressionDataPair(modelExp, 1);
    // one column of reference data in two dimensional array
    double[][] refData = new double[1][];
    refData[0] = data;
    // column names
    String[] colNames = new String[] { ReservedVariable.TIME.getName(), "intensity" };
    // weights
    Weights dataWeights = weights;
    if (dataWeights == null) {
        dataWeights = new VariableWeights(new double[] { 1.0 });
    }
    return CurveFitting.solve(expDataPairs, parameters, time, refData, colNames, dataWeights);
}
Also used : VariableWeights(cbit.vcell.opt.VariableWeights) Weights(cbit.vcell.opt.Weights) VariableWeights(cbit.vcell.opt.VariableWeights) ExplicitFitObjectiveFunction(cbit.vcell.opt.ExplicitFitObjectiveFunction)

Aggregations

ExplicitFitObjectiveFunction (cbit.vcell.opt.ExplicitFitObjectiveFunction)1 VariableWeights (cbit.vcell.opt.VariableWeights)1 Weights (cbit.vcell.opt.Weights)1