Rank: 4 based on 3266 downloads (last 30 days) and 68 files submitted
photo

John D'Errico

E-mail
Company/University
Consultant
Lat/Long
43.236435, -76.93324

Personal Profile:

Retired from the Eastman Kodak Company, where I was an applied mathematician consulting typically on matters of curve fitting, modeling, and numerical analysis. I enjoy playing bridge, doing woodworking and woodturning, and going for walks. We have a sweet wire hair fox terrier. In my spare time I still like to use Matlab.

Professional Interests:
Numerical analysis, mathematical modeling

 

Watch this Author's files

 

Files Posted by John View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
29 Jul 2010 Published M-Files Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico 2d surfaces, scattered data, surface fitting, surface, regression, interpolation 408 57
  • 4.89286
4.9 | 57 ratings
21 Jul 2010 Published M-Files SLM - Shape Language Modeling Least squares spline modeling using shape primitives Author: John D'Errico shape, free knots, interpolation, spline, splines, slm 242 30
  • 5.0
5.0 | 20 ratings
30 Jun 2010 LSE A linear least squares solver, subject to linear equality constraints Author: John D'Errico regression, least, squares, linear, linear algebra, constraints 117 4
  • 5.0
5.0 | 3 ratings
17 Jun 2010 Moving window standard deviation A (fast) windowed std on a time series Author: John D'Errico windowed running std ..., dsp 100 7
  • 4.875
4.9 | 8 ratings
04 Jun 2010 Minimum Radius Bounding Sphere Minimum radius bounding sphere around a 3d set of points Author: John D'Errico enclose, minimum, sphere, optimum, radius, enclosing 34 14
  • 3.8
3.8 | 7 ratings
Comments and Ratings by John View all
Updated File Comments Rating
29 Jul 2010 Solves a custom set of linear simultaneous equations This solution is for a student (Yvonne) Author: Bruce

I just added one more download myself. But that does not mean it is of any value at all. I had to download it to know that it is worthless, even as a homework assignment.

There is no help in this code, and it is extremely specific to an apparent homework problem for this particular student.

This submission is a script that will clear your matlab workspace. In order to use it, you must edit the code, hard coding in the equations. (I'm sorry, but while that is how students seem to use matlab, it is simply poor coding style once you start to use matlab in any serious way.)

The only thing that is of any value here are the internal comments. I do like that aspect, but nothing else that I found.

28 Jul 2010 Contours for triangular grids Generate smooth contours for functions defined on unstructured triangular grids Author: Darren Engwirda

In the test case given by Xavy, note that there are a pair of points at (x,y) == (1,1). This will cause any such routine to fail that is based on triangulating the data.

With replicates in your data, remove them, averaging the z values at those replicated points.

Of course, even this will not help your example, since you then try to create a triangulation

> T=[1,2,3;4,5,6;7,8,9];

You only have SIX points in the set of point in A. Surely you cannot create a triangulation that refers to points 7, 8 and 9 too! A valid triangulation of this data would be

T = [1 2 3;2 3 5;3 5 6];

See that I never needed to use point 4, but also that this is a valid triangulation. I would expect tricontour to work properly with this triangulation.

22 Jul 2010 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico

I like Adam's idea, and this is easily enough put into the code.

20 Jul 2010 SLM - Shape Language Modeling Least squares spline modeling using shape primitives Author: John D'Errico

- I should be able to add a constraint on the trend of the curvature. Really, what I'll do is allow the user to constrain the sign of the third derivative. In combination with constraints on the sign of the second derivative, this will allow you to create a function with increasing or decreasing curvature as desired.

- Constraints on monotonic behavior for the first derivative (increasing or decreasing) are already present, in the form of the concaveup or concavedown properties. I'll add a comment in the help to emphasize this fact.

- A constraint on the total arc length of the curve is difficult, since this is a nonlinear constraint. This would force the use of a nonlinear optimizer like fmincon when that constraint is applied.

12 Jul 2010 Consolidator Consolidates common elements in x (may be n-dimensional), aggregating corresponding y. Author: John D'Errico

More digging shows that the behavior Christophe finds is a function of rounding, and of floating point arithmetic in general. But it is not something that I can make consolidator robust to, since variations at the least significant bit level will always cause problems in such a code.

This choice of a tolerance made by Christophe forces matlab/consolidator to perform a comparison between floating point numbers. With the tolerance set to exactly the difference between consecutive terms in the set provided, in some cases there MUST be a failure. PLEASE read this document:

http://docs.sun.com/source/806-3568/ncg_goldberg.html

The use of floating point arithmetic in MATLAB causes this to fail. Here, using a version of consolidator with a subtly different internal test, I get the result that Christophe did:

consolidator([1,2,3,3.01,6]',[],[],1)
ans =
                    1.5
                    3
                    3.01
                    6

Yet now change the tolerance by only an infinitesimal amount, and we can get yet a different set of rounding results.

consolidator([1,2,3,3.01,6]',[],[],1-10*eps)
ans =
                    1
                    2.5
                    3.01
                    6

consolidator([1,2,3,3.01,6]',[],[],.9999999999999)
ans =
                    1
                    2
                    3.005
                    6

Again, these differences arise because of floating point arithmetic and the use of a tolerance that is so close to the stride between members of the set. This is not something that I can change, fix, repair, or code in a better way, because if I did make a change then some other set of data would cause the same problems.

I will argue that this is what I call the transitivity problem. When you specify a tolerance of 1, how is consolidator to resolve the set [1 2 3]? Are 1 and 2 to be lumped together? Or 2 and 3? Clearly, each of those pairs are the same to within a tolerance of 1. Yet we cannot lump them all into a single group, because 1 and 3 are not within the specified tolerance. Or should we? We might very logically argue to aggregate them down to any of these sets:

[1, 2, 3]
[1.5, 3]
[1, 2.5]
[1.5, 2.5]
[2]

The point is, beware of tests that compare floating point numbers. And beware of forcing code to make those tests. You can (and will) see virtually random results from doing so.

Finally, avoid use of a tolerance that is so close to the stride between elements of the set to be resolved. Consolidator is not designed to be a clustering tool, but to be a tool that will combine replicate values together and to survive small amounts of noise in the data. The tolerance allows minor variations in the numbers to be thus combined. If you try to use consolidator to cluster numbers together, it might succeed, but you can trip it up. And no matter what, the transitivity problem is important, and is not capable of resolution in an unambiguous manner, for ALL sets of data.

John

Comments and Ratings on John's Files View all
Updated File Comment by Comments Rating
30 Jul 2010 SLM - Shape Language Modeling Least squares spline modeling using shape primitives Author: John D'Errico Avital, Royi

Is there any article which could be used as reference to this kind of fitting?
I'd like to use this tool in my project and would like to back it up with some background info.

Thanks for this amazing tool.

30 Jul 2010 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico Chapman, Adam

the new setting "'smoothness',[xsmooth ysmooth]" is a Godsend. Many Thanks

26 Jul 2010 Minimal Bounding Rectangle Minimal bounding rectangle around points in the (x,y) plane Author: John D'Errico m, m

Thanks for sharing the code, very well written... I have one question though...
What is the name of the implemented algorithm?

22 Jul 2010 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico D'Errico, John

I like Adam's idea, and this is easily enough put into the code.

22 Jul 2010 Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico Chapman, Adam

This is brilliant, but a capability to vary the degree of smoothing in x and y exclusively would be very useful

Top Tags Applied by John
interpolation, approximation, computational geometry, matrices, minimum
Files Tagged by John View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
29 Jul 2010 Published M-Files Surface Fitting using gridfit Model 2-d surfaces from scattered data Author: John D'Errico 2d surfaces, scattered data, surface fitting, surface, regression, interpolation 408 57
  • 4.89286
4.9 | 57 ratings
21 Jul 2010 Published M-Files SLM - Shape Language Modeling Least squares spline modeling using shape primitives Author: John D'Errico shape, free knots, interpolation, spline, splines, slm 242 30
  • 5.0
5.0 | 20 ratings
30 Jun 2010 LSE A linear least squares solver, subject to linear equality constraints Author: John D'Errico regression, least, squares, linear, linear algebra, constraints 117 4
  • 5.0
5.0 | 3 ratings
17 Jun 2010 Moving window standard deviation A (fast) windowed std on a time series Author: John D'Errico windowed running std ..., dsp 100 7
  • 4.875
4.9 | 8 ratings
04 Jun 2010 Minimum Radius Bounding Sphere Minimum radius bounding sphere around a 3d set of points Author: John D'Errico enclose, minimum, sphere, optimum, radius, enclosing 34 14
  • 3.8
3.8 | 7 ratings

Contact us at files@mathworks.com