本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

非线性最小二乘(曲线拟合)

以串行或并行方式求解非线性最小二乘(曲线拟合)问题

在开始求解优化问题之前,您必须选择合适的方法:基于问题或基于求解器。有关详细信息,请参阅 首先选择基于问题或基于求解器的方法

非线性最小二乘求解 min(∑||F(xi) – yi||2),其中 F(xi) 是一个非线性函数,yi 是数据。请参阅 非线性最小二乘(曲线拟合)

对于基于问题的方法,请创建问题变量,然后用这些符号变量表示目标函数和约束。有关基于问题的求解步骤,请参阅Problem-Based Optimization Workflow。要求解生成的问题,请使用 solve

有关基于求解器的求解步骤,包括定义目标函数和约束,以及选择合适的求解器,请参阅基于求解器的优化问题设置。要求解生成的问题,请使用 lsqcurvefitlsqnonlin

函数

全部展开

evaluateEvaluate optimization expression
infeasibilityConstraint violation at a point
optimproblemCreate optimization problem
optimvarCreate optimization variables
solveSolve optimization problem or equation problem
lsqcurvefitSolve nonlinear curve-fitting (data-fitting) problems in least-squares sense
lsqnonlinSolve nonlinear least-squares (nonlinear data-fitting) problems

主题

基于问题的非线性最小二乘

Nonlinear Least-Squares, Problem-Based

Basic example of nonlinear least squares using the problem-based approach.

Nonlinear Data-Fitting Using Several Problem-Based Approaches

Solve a least-squares fitting problem using different solvers and different approaches to linear parameters.

Fit ODE, Problem-Based

Fit parameters on an ODE using problem-based least squares.

基于求解器的非线性最小二乘

非线性数据拟合

显示求解数据拟合问题的几种方法的基本示例。

Banana Function Minimization

Shows how to solve for the minimum of Rosenbrock's function using different solvers, with or without gradients.

lsqnonlin with a Simulink® Model

Example of fitting a simulated model.

Nonlinear Least Squares Without and Including Jacobian

Example showing the use of analytic derivatives in nonlinear least squares.

用 lsqcurvefit 进行非线性曲线拟合

显示如何用 lsqcurvefit 进行非线性数据拟合的示例。

拟合常微分方程 (ODE)

示例说明如何对数据进行 ODE 的参数拟合,或对 ODE 的解进行曲线参数拟合。

Fit a Model to Complex-Valued Data

Example showing how to solve a nonlinear least-squares problem that has complex-valued data.

并行计算

What Is Parallel Computing in Optimization Toolbox?

Use multiple processors for optimization.

Using Parallel Computing in Optimization Toolbox

Perform gradient estimation in parallel.

Improving Performance with Parallel Computing

Investigate factors for speeding optimizations.

算法和选项

Write Objective Function for Problem-Based Least Squares

Syntax rules for problem-based least squares.

最小二乘(模型拟合)算法

在仅具有边界或线性约束的情况下,在 n 个维度中最小化平方和。

优化选项参考

了解优化选项。