[Master Index] [Index for PublicToolbox/regutools]

# tsvd

## (PublicToolbox/regutools/tsvd.m in BrainStorm 2.0 (Alpha))

### Function Synopsis

    x_k = tsvd(U,s,V,b,k)

### Help Text

    TSVD Truncated SVD regularization.

     x_k = tsvd(U,s,V,b,k)

     Computes the truncated SVD solution
        x_k = V(:,1:k)*inv(diag(s(1:k)))*U(:,1:k)'*b .
     If k is a vector, then x_k is a matrix such that
        x_k = [ x_k(1), x_k(2), ... ] .

### Cross-Reference Information

This function is called by

    fil_fac                            C:\BrainStorm_2001\PublicToolbox\regutools\fil_fac.m
    gcv                                C:\BrainStorm_2001\PublicToolbox\regutools\gcv.m
    l_corner                           C:\BrainStorm_2001\PublicToolbox\regutools\l_corner.m
    l_curve                            C:\BrainStorm_2001\PublicToolbox\regutools\l_curve.m
    muopt                              C:\BrainStorm_2001\Toolbox\muopt.m
    quasiopt                           C:\BrainStorm_2001\PublicToolbox\regutools\quasiopt.m
    regudemo                           C:\BrainStorm_2001\PublicToolbox\regutools\regudemo.m

### Listing of function C:\BrainStorm_2001\PublicToolbox\regutools\tsvd.m

    function x_k = tsvd(U,s,V,b,k)
    %TSVD Truncated SVD regularization.
    %
    % x_k = tsvd(U,s,V,b,k)
    %
    % Computes the truncated SVD solution
    %    x_k = V(:,1:k)*inv(diag(s(1:k)))*U(:,1:k)'*b .
    % If k is a vector, then x_k is a matrix such that
    %    x_k = [ x_k(1), x_k(2), ... ] .

    % Per Christian Hansen, UNI-C, 11/18/91.

    % Initialization.
    [n,p] = size(V); lk = length(k);
    if (min(k)<1 | max(k)>p)
      error('Illegal truncation parameter k')
    end
    x_k = zeros(n,lk); xi = (U(:,1:p)'*b)./s;

    % Treat each k separately.
    for j=1:lk
      i = k(j);
      x_k(:,j) = V(:,1:i)*xi(1:i);
    end

Produced by color_mat2html, a customized BrainStorm 2.0 (Alpha) version of mat2html on Tue Nov 2 16:17:59 2004
Cross-Directory links are: ON