function Theta = boot_GMt(rep,U,V,lambdas,nu,weight,alpha) %function Tboot = boot_GMt(rep,U,V,l,nu,wgt,trp) % Residual-bootstrapped GMt functional regression estimator % % INPUT % rep (scalar) Number of bootstrap replications % U (n x p) Reduced-rank standardized component scores of X % V (n x p) Reduced-rank standardized component scores of Y % l (p x 1) Eigenvalues of PCs of X % nu (scalar) Degrees of freedom of the t used as loss function % wgt (char) Trimming type: "metric" or "rank" % trp (scalar) Trimming proportion (between 0 and 1) % % OUTPUT % Tboot (p x q x rep) Bootsrap replications of regression estimator [n,p] = size(U); q = size(V,2); T0 = treg(U,V,lambdas,nu,weight,alpha,'off'); R = V-U*T0; Theta = zeros(p,q,rep); for i = 1:rep iboot = randi(n,[n 1]); Vboot = U*T0 + R(iboot,:); Theta(:,:,i) = treg(U,Vboot,lambdas,nu,weight,alpha,'off'); end