% This script demonstrates that a data matrix where the data % are all of a single sinusoidal frequency produces only two % nonzero singular values. % Interval end points t_low = 0; t_high = 3; % Time step size del_t = 0.05; % Time Points T = [t_low:del_t:t_high]; % Number of time points N = length(T); % Number of genes n = 500; % Frequency for the data w = 2*pi; % The random amplitude and phase offset for each gene. phi = 2*pi*rand(n,1); amp = 10*rand(n,1); % Generate the sinusoidal data matrix A = w*del_t*ones(n,1)*[0:N-1] + phi*ones(1,N); A = diag(amp)*sin(A); [U,S,V] = svd(A); S = diag(S); S(1:10) % Plot first 2 "modes" figure(1); hold off; plot(T',V(:,1)); hold on; plot(T',V(:,2)); % Plot first 2 "modes" figure(2); hold off; plot(T',V(:,3)); hold on; plot(T',V(:,20)); hold off;