Rank: 131 based on 1513 downloads (last 30 days) and 15 files submitted
photo

Joshua Carmichael

E-mail

Personal Profile:

Geophysics graduate student. Research: Glaciology, seismology, applied functional analysis.
http://www.ess.washington.edu/~joshuadc

Professional Interests:
Hilbert Spaces, best basis projections, applied math, geophysics

 

Watch this Author's files

 

Files Posted by Joshua View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
13 Nov 2009 Retrieves SAC files from station & date info. This function returns a vector of SAC file names Author: Joshua Carmichael iris, seismic, sac, data import, seismology, pascal 20 0
13 Nov 2009 Get files Retrieves cell array of file names from current directory Author: Joshua Carmichael sac, seismology, data import, regular expression, file reading 34 0
08 May 2009 Coherently aligns data Aligns data according to cross-corr maxima Author: Joshua Carmichael cross correlation, plotting, coherency analysis, array processing, align, signal processing 100 0
11 Apr 2009 Screenshot Windowed Conic Matching Pursuit Projects long-time series onto lower-dim cones Author: Joshua Carmichael cone decomposition th..., projection onto conve..., convex sets, matching pursuit, projection 105 0
11 Apr 2009 Screenshot Conic Matching Pursuit Expands data as sum of conic projections Author: Joshua Carmichael cone decomposition th..., convex sets, matching pursuit, projections 101 0
Comments and Ratings by Joshua
Updated File Comments Rating
31 Jan 2009 PDD Melt Calculates melt for a DEM based on positive degree days factor Author: Felix Hebeler

Seems to work well. Would like to use shorter time periods.

Comments and Ratings on Joshua's Files View all
Updated File Comment by Comments Rating
29 Nov 2007 conjorth Constructs conjugate-orthogonal basis from matrix Author: Joshua Carmichael Davis, Tim

You are doing something like C * ((C'*C) \ C').
The latter part is (C'*C)\C' which is the normal eqn's form of just C\I. Isn't that prefered for accuracy? It is slower than the (C'*C \ C') form, a bit.

29 Nov 2007 conjorth Constructs conjugate-orthogonal basis from matrix Author: Joshua Carmichael Davis, Tim

You did warn us that it's slow for large matrices ... (the time complexity is probably O(n^4)).

This cuts the time in half (18 seconds to 9 seconds for n=300):

for k = 3:Nw
    C = A*U(:,1:k-1) ;
    projv = (I - C*((C'*C)\C')) * W(:,k) ;
    U(:,k) = projv / norm (projv) ;
end

29 Nov 2007 conjorth Constructs conjugate-orthogonal basis from matrix Author: Joshua Carmichael Davis, Tim

That's odd. Yes, I did download and review the version with "inv" in it. The newer version looks much better. For this updated version, I would suggest writing

projv = (I-P)*W(:,k) ;

and remove the Pc and v variables, in the interest of speed and simplicity, but that's a minor point. (For that matter, the variable P can be removed too).

Looks great.

26 Nov 2007 conjorth Constructs conjugate-orthogonal basis from matrix Author: Joshua Carmichael D'Errico, John

Tim appears to have looked at the first version of the code. The author has since fixed the problems I noted, including the use of inv.

There is also now error checking, plus an H1 line, plus preallocation for U, etc.

As for the issue of sparse A, my guess is that this code will be slow anyway. So if A is large enough that sparse storage is necessary, then get a cup of coffee.

26 Nov 2007 conjorth Constructs conjugate-orthogonal basis from matrix Author: Joshua Carmichael Davis, Tim

John is right ... no one should ever multiply by the inverse. You should replace the line

    P=(A*U)*inv((A*U)'*(A*U))*(A*U)';

with

    P=(A*U) * (((A*U)'*(A*U)) \ (A*U)') ;

Multiplying by the inverse is shockingly common in files posted at the File Exchange. It should never be done. Even if A is diagonal, A\b is better than inv(A)*b.

Also, if you'd like to work with sparse W and A, you should replace the line:

   I=eye(size(A));

with

 if (issparse (A))
    I = speye (size (A)) ;
 else
    I = eye (size (A)) ;
 end

My guess is that if W and A are sparse then U will probably be all nonzero anyway, though, so the above probably isn't helpful. If you pass sparse W and A, then U will be returned full, with the current version of the code.

What is the statement v=W(:,k) doing inside the for loop? You don't use v later on at all, but you do use W(:,k) itself.

I would also recommend replacing the "disp" with "warning".

Top Tags Applied by Joshua
plotting, dsp, signal processing, matching pursuit, annotation
Files Tagged by Joshua View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
13 Nov 2009 Retrieves SAC files from station & date info. This function returns a vector of SAC file names Author: Joshua Carmichael iris, seismic, sac, data import, seismology, pascal 20 0
13 Nov 2009 Get files Retrieves cell array of file names from current directory Author: Joshua Carmichael sac, seismology, data import, regular expression, file reading 34 0
08 May 2009 Coherently aligns data Aligns data according to cross-corr maxima Author: Joshua Carmichael cross correlation, plotting, coherency analysis, array processing, align, signal processing 100 0
11 Apr 2009 Screenshot Windowed Conic Matching Pursuit Projects long-time series onto lower-dim cones Author: Joshua Carmichael cone decomposition th..., projection onto conve..., convex sets, matching pursuit, projection 105 0
11 Apr 2009 Screenshot Conic Matching Pursuit Expands data as sum of conic projections Author: Joshua Carmichael cone decomposition th..., convex sets, matching pursuit, projections 101 0
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com