• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ModelFunctionJacobian类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fit

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的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


示例2: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(double[] params) {
                double[][] jacobian = new double[time.size()][5];

                for (int i = 0; i < jacobian.length; ++i) {
                    final double t = time.get(i);
                    jacobian[i][0] = 1;

                    final double p3 =  params[3];
                    final double p4 =  params[4];
                    final double tOp3 = t / p3;
                    final double tOp4 = t / p4;
                    jacobian[i][1] = FastMath.exp(-tOp3);
                    jacobian[i][2] = FastMath.exp(-tOp4);
                    jacobian[i][3] = params[1] * FastMath.exp(-tOp3) * tOp3 / p3;
                    jacobian[i][4] = params[2] * FastMath.exp(-tOp4) * tOp4 / p4;
                }
                return jacobian;
            }
        });
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:23,代码来源:LevenbergMarquardtOptimizerTest.java


示例3: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(double[] params) {
                double[][] jacobian = new double[time.size()][5];

                for (int i = 0; i < jacobian.length; ++i) {
                    final double t = time.get(i);
                    jacobian[i][0] = 1;

                    final double p3 =  params[3];
                    final double p4 =  params[4];
                    final double tOp3 = t / p3;
                    final double tOp4 = t / p4;
                    jacobian[i][1] = Math.exp(-tOp3);
                    jacobian[i][2] = Math.exp(-tOp4);
                    jacobian[i][3] = params[1] * Math.exp(-tOp3) * tOp3 / p3;
                    jacobian[i][4] = params[2] * Math.exp(-tOp4) * tOp4 / p4;
                }
                return jacobian;
            }
        });
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:LevenbergMarquardtOptimizerTest.java


示例4: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
/**
 * @return the model function Jacobian.
 */
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            /** {@inheritDoc} */
            public double[][] value(double[] point) {
                final double[][] jacobian = new double[observations.size()][];
                int i = 0;
                for (WeightedObservedPoint observed : observations) {
                    jacobian[i++] = f.gradient(observed.getX(), point);
                }
                return jacobian;
            }
        });
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:17,代码来源:CurveFitter.java


示例5: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
/**
 * @return the model function Jacobian.
 */
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(double[] point) {
                final double[][] jacobian = new double[observations.size()][];
                int i = 0;
                for (WeightedObservedPoint observed : observations) {
                    jacobian[i++] = f.gradient(observed.getX(), point);
                }
                return jacobian;
            }
        });
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:16,代码来源:CurveFitter.java


示例6: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(double[] params) {
                return factors.getData();
            }
        });
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:AbstractLeastSquaresOptimizerAbstractTest.java


示例7: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(double[] params) {
                final int n = points.size();
                final Vector2D center = new Vector2D(params[0], params[1]);

                double dRdX = 0;
                double dRdY = 0;
                for (Vector2D pk : points) {
                    double dk = pk.distance(center);
                    dRdX += (center.getX() - pk.getX()) / dk;
                    dRdY += (center.getY() - pk.getY()) / dk;
                }
                dRdX /= n;
                dRdY /= n;

                // Jacobian of the radius residuals.
                double[][] jacobian = new double[n][2];
                for (int i = 0; i < n; i++) {
                    final Vector2D pi = points.get(i);
                    final double di = pi.distance(center);
                    jacobian[i][0] = (center.getX() - pi.getX()) / di - dRdX;
                    jacobian[i][1] = (center.getY() - pi.getY()) / di - dRdY;
                }

                return jacobian;
            }
    });
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:30,代码来源:CircleVectorial.java


示例8: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(double[] point) {
                return jacobian(point);
            }
        });
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:StraightLineProblem.java


示例9: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(double[] point) {
                return computeJacobian(point);
            }
        });
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:MinpackTest.java


示例10: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(double[] point) {
                return jacobian(point);
            }
    });
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:8,代码来源:CircleProblem.java


示例11: getModelFunctionJacobian

import org.apache.commons.math3.optim.nonlinear.vector.ModelFunctionJacobian; //导入依赖的package包/类
public ModelFunctionJacobian getModelFunctionJacobian() {
    return new ModelFunctionJacobian(new MultivariateMatrixFunction() {
            public double[][] value(final double[] a)
                throws IllegalArgumentException {
                final int n = getNumObservations();
                final double[][] j = new double[n][];
                for (int i = 0; i < n; i++) {
                    j[i] = getModelDerivatives(getX(i), a);
                }
                return j;
            }
        });
}
 
开发者ID:Quanticol,项目名称:CARMA,代码行数:14,代码来源:StatisticalReferenceDataset.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IClassCoverage类代码示例发布时间:2022-05-23
下一篇:
Java IExtension类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap