Rank: 5 based on 3920 downloads (last 30 days) and 52 files submitted
photo

John D'Errico

E-mail
Company/University
Retired

Personal Profile:

Mainly retired from Eastman Kodak. (Of course, Kodak itself is now semi-retired. I don't think I had any influence in that.) I still write MATLAB code as I find something interesting, but I DON'T answer your questions, and I do NOT do homework. Your homework is YOUR problem, not mine. Do NOT e-mail me with your homework problems or student projects. When I'm not doing something with MATLAB, you might find me playing bridge.


 

Watch this Author's files

 

Files Posted by John D'Errico View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
03 Dec 2014 Symbolic Polynomial Manipulation Symbolic polynomial manipulation as an exercise in OOP Author: John D'Errico symbolic, polynomial, arithmetic, algebra, sym, sympoly 76 6
  • 4.85714
4.9 | 7 ratings
03 Dec 2014 Adaptive Robust Numerical Differentiation Numerical derivative of an analytically supplied function, also gradient, Jacobian & Hessian Author: John D'Errico hessian, jacobian, toolbox, adaptive, differentiation, automatic 278 55
  • 4.85714
4.9 | 35 ratings
03 Dec 2014 Variable Precision Integer Arithmetic Arithmetic with integers of fully arbitrary size. Arrays and vectors of vpi numbers are supported. Author: John D'Errico finite field, integer, biginteger, arithmetic, operator, overloading 110 129
  • 4.85
4.8 | 44 ratings
03 Dec 2014 HPF - a big decimal class High precision floating point arithmetic, a new class written in MATLAB Author: John D'Errico hpf, multiple precision, big decimal, floating point, arithmetic, mathematics 49 20
  • 5.0
5.0 | 9 ratings
16 Oct 2014 movingstd(x,k,windowmode) A (fast) windowed std on a time series Author: John D'Errico movingavg, standard deviation, std, window, filter 125 18
  • 4.75
4.8 | 12 ratings
Comments and Ratings by John D'Errico View all
Updated File Comments Rating
17 Dec 2014 Sine function fit Optimization of parameters of the sine function to time series Author: R P

Good point by Alex to recover c.

03 Dec 2014 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico

Of course, the simple answer for Chad is to put a basic wrapper around gridfit, one that tests the data, and compares it to the nodes in advance. If the nodes were not chosen to contain the data, then fix them so they are. No warning need ever be generated then. Then just have the wrapper code pass all arguments into gridfit.

03 Dec 2014 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico

I (or you) could change the code as Chad has suggested. Personally, I don't think this is a good idea, since gridfit appends new nodes, expanding the grid when it finds this condition. That means the size of the grid as an array is no longer as you might have expected it, so a warning seems merited. And even if the nodes were just moved without telling you, I think this is a bad idea to say nothing.

As it is now, if you really positively don't want a warning, then you can turn that warning off. That is a documented option for the 'extend' parameter. Essentially, as I have it written now, if the code does something to the grid that is not as you expect it, it generates a warning unless you tell it not to generate a warning. I'm just not comfortable with the idea of a wishy-washy warning, that may or may not generate a warning when it encounters something surprising.

22 Nov 2014 do fft a method to change signal from time domain to frequency domain Author: Freya Xiang

Bad news here, for little good.

This function is called fft. Inside the function itself, it then tries to call fft. I assume the author intends for it to then use the built-in fft. Of course, there will be a problem, since MATLAB will be confused.

No help, no explanation of what it returns. No reason to give it better than 1 star.

19 Nov 2014 Making given matrix singular Making the given matrix singular by adding a matrix with multiplier. Author: Feng Cheng Chang

I never said you could use norm to test for singularity of a matrix!

I did say you could use rank, cond, or svd to determine that status, AND be far ahead of the use of det.

I already showed how poor det is, using several examples. It is simply a terrible idea to use that tool. Yes, I know that your teacher told you about it, or some book you read. The fact is, they probably learned it from someone before them, and they are just propagating the use of a terrible tool for the purpose.

When you use det in floating point arithmetic, is is simply a bad thing to do. This is what those people who taught you did not understand. They thought that because something is valid in a mathematical sense, that it is a good thing to do on a computer. Sorry, but computer programming is NOT mathematics. Floating point arithmetic is a different animal, and is only vaguely related to mathematics.

The simple answer is to just use rank. If the matrix is less than full rank, then it is singular.

If you want, you can use cond. Large condition numbers are bad. A condition number that is roughly 1/eps indicates singularity. The problem with cond is it takes some (minor) judgment on your part. How close does a condition number need to be to 1/eps for the matrix to be numerically singular? At the same time, use of cond gives you some information that rank does not, since it tells you how close to singularity is the matrix.

And of course, you can use svd, which tells you more yet. Since the condition number is the ratio of the largest to smallest singular values, you can see if the matrix is singular easily enough. But several singular values that are relatively zero compared to the largest tells you much about the matrix too.

Again, rank is simplest here, FAR better than det. Avoid det, like you would avoid the bubonic plague. I showed several cases where det simply fails to yield an answer that is even close to truth.

Comments and Ratings on John D'Errico's Files View all
Updated File Comment by Comments Rating
17 Dec 2014 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico Darin

Not only a great tool, the source code and the discussions here are a great education. Thanks, John, for extending the docs and examples

It usually does everything I need. When really off-the-wall needs have come up, it's been a great base to start from. Clear and well structured code.

11 Dec 2014 Eigenshuffle Consistently sorted eigenvalue and eigenvector sequences Author: John D'Errico William

Works very well. Not only performs the eig function over arrays of matrices, but sorts the eigenvalues and eigenvectors in a rational way.

06 Dec 2014 A suite of minimal bounding objects Suite of tools to compute minimal bounding circles, rectangles, triangles, spheres, incircles, etc. Author: John D'Errico Andrew

04 Dec 2014 Symbolic Polynomial Manipulation Symbolic polynomial manipulation as an exercise in OOP Author: John D'Errico Mark Mikofski

Hi John! Happy to see you are still cranking and contributing your genius to the MATLAB community. Are you still experimenting with Python anymore? FYI: Python has a great symbolic toolbox called SymPy (http://www.sympy.org/en/index.html) similar to MATLAB and Maple, completely free, and available with the Anaconda Scientific Python Distribution from Continuum Analytics (https://store.continuum.io/cshop/anaconda/). Also you should seriously get on GitHub (https://github.com/). Take Care!

03 Dec 2014 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico John D'Errico

Of course, the simple answer for Chad is to put a basic wrapper around gridfit, one that tests the data, and compares it to the nodes in advance. If the nodes were not chosen to contain the data, then fix them so they are. No warning need ever be generated then. Then just have the wrapper code pass all arguments into gridfit.

Contact us