Current location - Training Enrollment Network - Mathematics courses - [Mathematical modeling algorithm] (28) Interpolation and fitting: least square optimization
[Mathematical modeling algorithm] (28) Interpolation and fitting: least square optimization
In unconstrained optimization problems, there are some important special cases, for example, the objective function is composed of the sum of squares of several functions. This function can generally be written as:

Among them, it is generally believed that. We minimize the problem of this function:

It is called the least square optimization problem.

Find a solution

Science and technology.

Where is a matrix and a vector.

Matlab function is:

x=lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0)

Solution: The steps are as follows:

Given the input-output sequence, finding parameters makes

The functions in Matlab are:

X=lsqcurvefit(FUN,X0,XDATA,YDATA,LB,UB,OPTIONS)

Where FUN is the n file that defines the function.

Solution: This problem is to solve the optimization problem:

There are two steps to solve this problem:

First, write the function that requires the solution:

Given the function vector, it is found that:

The functions in Matlab are:

Use this function to solve Example 2:

First, write a function with parameters to be found:

Then call lsqnonlin function and write the following program:

Solve nonnegative, thus satisfying.

The functions in Matlab are:

The plan is as follows: