資源簡介
牛頓法牛頓法牛頓法牛頓法牛頓法牛頓法牛頓法牛頓法牛頓法牛頓法
代碼片段和文件信息
function?[x?y]?=?newton(Abx0niter)
%[x?y]?=?newton(Abx0niter);
%solves?the?linear?least?squares?problem?with?nonnegative?variables?using?the?newton‘s?algorithm?in?[1].
%Input:
%???A:??????[MxN]?matrix?
%???b:??????[Mx1]?vector
%???x0:?????[Nx1]?vector?of?initial?values.?x0?>?0.?Default?value:?ones(n1)
%???niter:??Number?of?iterations.?Default?value:?10
%Output
%???x:??????solution
%???y:??????complementary?solution
%
%?[1]?Portugal?Judice?and?Vicente?A?comparison?of?block?pivoting?and
%?interior?point?algorithms?for?linear?least?squares?problems?with
%?nonnegative?variables?Mathematics?of?Computation?63(1994)?pp.?625-643
%
%Uriel?Roque
%02.05.2006
[mn]?=?size(A);
if?nargin?3
????x0?=?ones(n1);
????niter?=?10;
elseif?nargin?4
????niter?=?10;
end
if?isempty(x0)
????x0?=?ones(n1);
elseif?any(x0?<=?0)
????disp(‘Error.?The?initial?vector?should?be?nonzero‘);
????x?=?[];
????y?=?[];
????return
end
AtA?=?A‘*A;
Atb?=?A‘*b;
In?=?e
- 上一篇:EMD的MATLAB程序
- 下一篇:貝葉斯圖像去噪
評論
共有 條評論