C = τ2(ATA) − 1,
|
zi = A(xi − θ)
|
|
|
where | xi is a vector of length m containing the elements of the ith row of X, |
zi is a vector of length m, | |
I is the identity matrix and 0 is the zero matrix, | |
and | w and u are suitable functions. |
(i) | v(t) = 1 for all t, |
(ii) | v(t) = u(t). |
Ak = (Sk + I)Ak − 1
|
θjk = (bj)/(D1) + θjk − 1,
|
sjl =
|
Input Parameters
Output Parameters
Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.
(i) | d1 = the maximum value of |sjl| |
(ii) | d2 = the maximum absolute change in wt(i) |
(iii) | d3 = the maximum absolute relative change in θj |
Open in the MATLAB editor: nag_correg_robustm_corr_user_deriv_example
function nag_correg_robustm_corr_user_deriv_example indm = int64(1); x = [3.4, 6.9, 12.2; 6.4, 2.5, 15.1; 4.9, 5.5, 14.2; 7.3, 1.9, 18.2; 8.8, 3.6, 11.7; 8.4, 1.3, 17.9; 5.3, 3.1, 15; 2.7, 8.1, 7.7; 6.1, 3, 21.9; 5.3, 2.2, 13.9]; a = [1; 0; 1; 0; 0; 1]; theta = [0; 0; 0]; user = [4,2]; [user, covar, aOut, wt, thetaOut, nit, ifail] = ... nag_correg_robustm_corr_user_deriv(@ucv, indm, x, a, theta, 'user', user) function [user, u, ud, w, wd] = ucv(t, user) cu = user(1); u = 1.0; ud = 0.0; if (t ~= 0) t2 = t*t; if (t2 > cu) u = cu/t2; ud = -2.0*u/t; end end % w function and derivative cw = user(2); if (t > cw) w = cw/t; wd = -w/t; else w = 1.0; wd = 0.0; end
user = 4 2 covar = 3.2778 -3.6918 5.2841 4.7391 -6.4086 11.8371 aOut = 0.5523 1.0614 0.9424 -0.1881 0.4776 0.5021 wt = 1.0000 1.0000 1.0000 1.0000 0.2339 1.0000 1.0000 0.9385 0.4012 0.7579 thetaOut = 5.6998 3.8636 14.7036 nit = 25 ifail = 0
Open in the MATLAB editor: g02hl_example
function g02hl_example indm = int64(1); x = [3.4, 6.9, 12.2; 6.4, 2.5, 15.1; 4.9, 5.5, 14.2; 7.3, 1.9, 18.2; 8.8, 3.6, 11.7; 8.4, 1.3, 17.9; 5.3, 3.1, 15; 2.7, 8.1, 7.7; 6.1, 3, 21.9; 5.3, 2.2, 13.9]; a = [1; 0; 1; 0; 0; 1]; theta = [0; 0; 0]; user = [4,2]; [user, covar, aOut, wt, thetaOut, nit, ifail] = ... g02hl(@ucv, indm, x, a, theta, 'user', user) function [user, u, ud, w, wd] = ucv(t, user) cu = user(1); u = 1.0; ud = 0.0; if (t ~= 0) t2 = t*t; if (t2 > cu) u = cu/t2; ud = -2.0*u/t; end end % w function and derivative cw = user(2); if (t > cw) w = cw/t; wd = -w/t; else w = 1.0; wd = 0.0; end
user = 4 2 covar = 3.2778 -3.6918 5.2841 4.7391 -6.4086 11.8371 aOut = 0.5523 1.0614 0.9424 -0.1881 0.4776 0.5021 wt = 1.0000 1.0000 1.0000 1.0000 0.2339 1.0000 1.0000 0.9385 0.4012 0.7579 thetaOut = 5.6998 3.8636 14.7036 nit = 25 ifail = 0