本文整理汇总了Java中org.apache.commons.math3.optim.nonlinear.vector.ModelFunction类的典型用法代码示例。如果您正苦于以下问题:Java ModelFunction类的具体用法?Java ModelFunction怎么用?Java ModelFunction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelFunction类属于org.apache.commons.math3.optim.nonlinear.vector包,在下文中一共展示了ModelFunction类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getModelFunction
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
/**
* @return the model function values.
*/
public ModelFunction getModelFunction() {
return new ModelFunction(new MultivariateVectorFunction() {
/** {@inheritDoc} */
public double[] value(double[] point) {
// compute the residuals
final double[] values = new double[observations.size()];
int i = 0;
for (WeightedObservedPoint observed : observations) {
values[i++] = f.value(observed.getX(), point);
}
return values;
}
});
}
开发者ID:biocompibens,项目名称:SME,代码行数:19,代码来源:CurveFitter.java
示例2: fit
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
protected Molecule fit(ILsqFunctions functions) {
// init
double[] weights = functions.calcWeights(useWeighting);
double[] observations = functions.getObservations();
// fit
LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer(
new SimplePointChecker<PointVectorValuePair>(10e-10, 10e-10, maxIter));
PointVectorValuePair pv;
pv = optimizer.optimize(
MaxEval.unlimited(),
new MaxIter(MAX_ITERATIONS + 1),
new ModelFunction(functions.getValueFunction()),
new ModelFunctionJacobian(functions.getJacobianFunction()),
new Target(observations),
new InitialGuess(psfModel.transformParametersInverse(functions.getInitialParams())),
new Weight(weights));
// estimate background and return an instance of the `Molecule`
fittedParameters = pv.getPointRef();
if (bkgStdColumn >= 0) {
fittedParameters[bkgStdColumn] = VectorMath.stddev(sub(observations, functions.getValueFunction().value(fittedParameters)));
}
return psfModel.newInstanceFromParams(psfModel.transformParameters(fittedParameters), functions.getImageUnits(), true);
}
开发者ID:zitmen,项目名称:thunderstorm,代码行数:27,代码来源:LSQFitter.java
示例3: getModelFunction
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
public ModelFunction getModelFunction() {
return new ModelFunction(new MultivariateVectorFunction() {
public double[] value(double[] params) {
double[] values = new double[time.size()];
for (int i = 0; i < values.length; ++i) {
final double t = time.get(i);
values[i] = params[0] +
params[1] * FastMath.exp(-t / params[3]) +
params[2] * FastMath.exp(-t / params[4]);
}
return values;
}
});
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:15,代码来源:LevenbergMarquardtOptimizerTest.java
示例4: getModelFunction
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
public ModelFunction getModelFunction() {
return new ModelFunction(new MultivariateVectorFunction() {
public double[] value(double[] params) {
return factors.operate(params);
}
});
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:AbstractLeastSquaresOptimizerAbstractTest.java
示例5: getModelFunction
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
public ModelFunction getModelFunction() {
return new ModelFunction(new MultivariateVectorFunction() {
public double[] value(double[] params) {
Vector2D center = new Vector2D(params[0], params[1]);
double radius = getRadius(center);
double[] residuals = new double[points.size()];
for (int i = 0; i < residuals.length; i++) {
residuals[i] = points.get(i).distance(center) - radius;
}
return residuals;
}
});
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:15,代码来源:CircleVectorial.java
示例6: getModelFunction
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
public ModelFunction getModelFunction() {
return new ModelFunction(new MultivariateVectorFunction() {
public double[] value(double[] params) {
final Model line = new Model(params[0], params[1]);
final double[] model = new double[points.size()];
for (int i = 0; i < points.size(); i++) {
final double[] p = points.get(i);
model[i] = line.value(p[0]);
}
return model;
}
});
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:16,代码来源:StraightLineProblem.java
示例7: getModelFunction
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
public ModelFunction getModelFunction() {
return new ModelFunction(new MultivariateVectorFunction() {
public double[] value(double[] point) {
return computeValue(point);
}
});
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:MinpackTest.java
示例8: getModelFunction
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
public ModelFunction getModelFunction() {
return new ModelFunction(new MultivariateVectorFunction() {
public double[] value(final double[] a) {
final int n = getNumObservations();
final double[] yhat = new double[n];
for (int i = 0; i < n; i++) {
yhat[i] = getModelValue(getX(i), a);
}
return yhat;
}
});
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:13,代码来源:StatisticalReferenceDataset.java
示例9: getModelFunction
import org.apache.commons.math3.optim.nonlinear.vector.ModelFunction; //导入依赖的package包/类
public ModelFunction getModelFunction() {
return new ModelFunction(new MultivariateVectorFunction() {
public double[] value(double[] variables) {
double[] values = new double[x.size()];
for (int i = 0; i < values.length; ++i) {
values[i] = (variables[0] * x.get(i) + variables[1]) * x.get(i) + variables[2];
}
return values;
}
});
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:LevenbergMarquardtOptimizerTest.java
注:本文中的org.apache.commons.math3.optim.nonlinear.vector.ModelFunction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论