Re: [R] French Curve
Michael == Michael A Miller [EMAIL PROTECTED] on Tue, 05 Apr 2005 10:28:21 -0500 writes: dream == dream home [EMAIL PROTECTED] writes: Does it sound like spline work do the job? It would be hard to persuave him to use some modern math technique but he did ask me to help him implement the French Curve so he can do his work in Excel, rather than PAPER. Michael Splines are useful for interpolating points with a Michael continuous curve that passes through, or near, the Michael points. not only! (see below) Michael If you are looking for a way to estimate a Michael curve with a noise component removed, I think you'd Michael be better off filtering your data, rather than Michael interpolating with a spline. yes for rather than interpolating no for with a spline There's the smooth.spline() *smoothing* spline function (with predict() methods, even for 1st and 2nd derivatives) which is liked by `many' and even prefered to other ``filters'' for diverse reasons, notably for the fact that spline smoothing corresponds to linear filtering with a curvature-adaptive varying bandwith. Michael Median (or mean) filtering may give results Michael similar to those from your chemist's manual method. Michael That is easy to do with running from the gtools Michael package. The validity of this is another question! Median filtering aka running medians has one distinctive advantage {over smooth.spline() or other so called linear smoothers}: It is robust i.e. not distorted by gross outliers. Running medians is implemented in runmed() {standard stats package} in a particularly optimized way rather than using the more general running(.) approach of package 'gtools'. Martin Maechler, ETH Zurich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
On Apr 6, 2005, at 1:48 AM, Martin Maechler wrote: Median filtering aka running medians has one distinctive advantage {over smooth.spline() or other so called linear smoothers}: It is robust i.e. not distorted by gross outliers. Running medians is implemented in runmed() {standard stats package} in a particularly optimized way rather than using the more general running(.) approach of package 'gtools'. Median smoothing splines are also implemented in the quantreg package see ?rqss, but they produce piecewise linear fitting so they may not appeal to those accustomed to french curves. url:www.econ.uiuc.edu/~rogerRoger Koenker email [EMAIL PROTECTED] Department of Economics vox:217-333-4558University of Illinois fax:217-244-6678Champaign, IL 61820 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
dream == dream home [EMAIL PROTECTED] writes: Does it sound like spline work do the job? It would be hard to persuave him to use some modern math technique but he did ask me to help him implement the French Curve so he can do his work in Excel, rather than PAPER. Splines are useful for interpolating points with a continuous curve that passes through, or near, the points. If you are looking for a way to estimate a curve with a noise component removed, I think you'd be better off filtering your data, rather than interpolating with a spline. Median (or mean) filtering may give results similar to those from your chemist's manual method. That is easy to do with running from the gtools package. The validity of this is another question! require(gtools) x - seq(250)/10 y1 - sin(x) + 15 + rnorm(250)/2 y2 - cos(x) + 12 + rnorm(250) plot(x, y1, ylim=c(0,18), col='grey') points(x, y2, pch=2, col='grey') points(x, y1-y2, col='grey', pch=3) ## running median filters lines(running(x), running(y1, fun=median), col='blue') lines(running(x), running(y2, fun=median), col='blue') lines(running(x), running(y1, fun=median)-running(y2, fun=median), col='blue') ## running mean filters lines(running(x), running(y1), col='red') lines(running(x), running(y2), col='red') lines(running(x), running(y1)-running(y2), col='red') f - sin(x) + 15 - ( cos(x) + 12 ) lines(x, f) Mike -- Michael A. Miller [EMAIL PROTECTED] Imaging Sciences, Department of Radiology, IU School of Medicine __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
Thanks so much, Martin, Martyn, Marc and others for your insightful input on French Curve. From how the chemist is using the French Curve now, it seems he is using for spline. Basically, he has two curves from spectrometry data. To find the area underneath one curve without the noise area, he uses French Curve MANUALLY (on a piece of paper) and draws the French Curve on one curve (the curve of the area interested). Then he moves the French curve parallel to the other curve (b). The area underneath where French Curve from the other Curve (b) touches on the curve of interested is considered noise area. After all these hard work, he MANUALLY uses ruler again and draws the retangular bin and tries his best the get the area of interest. Does it sound like spline work do the job? It would be hard to persuave him to use some modern math technique but he did ask me to help him implement the French Curve so he can do his work in Excel, rather than PAPER. Thanks again for your help. Paul [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
dream == dream home [EMAIL PROTECTED] on Wed, 30 Mar 2005 12:27:08 -0800 writes: dream Dear R experts, Did someone implemented French Curve dream yet? Or can anyone point me some papers that I can dream follow to implement it? Are you talking about splines ? I vaguely remember having read that in the distant past, splines were sometimes called French curves. There's lots of splines functionality in the basic 'stats' package, in the recommended 'mgcv' package and even more in quite a few other packages. dream thanks in advance for your help. You're welcome, Martin Maechler, ETH Zurich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
On Fri, 2005-04-01 at 09:30 +0200, Martin Maechler wrote: dream == dream home [EMAIL PROTECTED] on Wed, 30 Mar 2005 12:27:08 -0800 writes: dream Dear R experts, Did someone implemented French Curve dream yet? Or can anyone point me some papers that I can dream follow to implement it? Are you talking about splines ? I vaguely remember having read that in the distant past, splines were sometimes called French curves. I found this: G. Wahba and S. Wold, A completely automatic french curve: Fitting splines by cross validation, Commun. Statist., vol. 4, no. 1, pp. 1-17, 1975. I remember that my father had a French curve: it was a plastic template used for drawing which had several smooth edges of varying curvature. You could use it to draw a wide variety of curved shapes. No doubt the French called it something else. There's lots of splines functionality in the basic 'stats' package, in the recommended 'mgcv' package and even more in quite a few other packages. dream thanks in advance for your help. You're welcome, Martin Maechler, ETH Zurich __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] French Curve
I remember that my father had a French curve: it was a plastic template used for drawing which had several smooth edges of varying curvature. You could use it to draw a wide variety of curved shapes. No doubt the French called it something else. Nobody, up and down the corridor here, of age to have used one, could think of a name, but we looked it up in a universal French dictionary on the web, and it came up with ``un pistolet''. Ken Knoblauch Inserm U371, Cerveau et Vision Department of Cognitive Neurosciences 18 avenue du Doyen Lepine 69675 Bron cedex France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: 06 84 10 64 10 http://www.lyon.inserm.fr/371/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
On Fri, 2005-04-01 at 17:00 +0200, Martyn Plummer wrote: On Fri, 2005-04-01 at 09:30 +0200, Martin Maechler wrote: dream == dream home [EMAIL PROTECTED] on Wed, 30 Mar 2005 12:27:08 -0800 writes: dream Dear R experts, Did someone implemented French Curve dream yet? Or can anyone point me some papers that I can dream follow to implement it? Are you talking about splines ? I vaguely remember having read that in the distant past, splines were sometimes called French curves. I found this: G. Wahba and S. Wold, A completely automatic french curve: Fitting splines by cross validation, Commun. Statist., vol. 4, no. 1, pp. 1-17, 1975. I remember that my father had a French curve: it was a plastic template used for drawing which had several smooth edges of varying curvature. You could use it to draw a wide variety of curved shapes. No doubt the French called it something else. http://mathworld.wolfram.com/FrenchCurve.html Martyn, My dad had one as well, along with his slide rule...then he later moved up to a TI DataMath as I recall... ;-) These days he is retired (was a medical school professor) and works on a G5. Best regards, Marc __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] French Curve
From: Ken Knoblauch I remember that my father had a French curve: it was a plastic template used for drawing which had several smooth edges of varying curvature. You could use it to draw a wide variety of curved shapes. No doubt the French called it something else. Nobody, up and down the corridor here, of age to have used one, could think of a name, but we looked it up in a universal French dictionary on the web, and it came up with ``un pistolet''. I recall reading: E.J. Wegman and I.W. Wright. Splines in Statistics. Journal of the American Statistical Association, vol 78, N382, 1983. which mentioned `spline' as a tool that draftsmen used to draw curves, but the description does not match the french curve I know, which _is_ a template-like piece of various curvature. (I used one of these in the year I spent in Architechture school right after high school. No, I not _that_ old... I believe they are still in common used today.) Andy Ken Knoblauch Inserm U371, Cerveau et Vision Department of Cognitive Neurosciences 18 avenue du Doyen Lepine 69675 Bron cedex France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: 06 84 10 64 10 http://www.lyon.inserm.fr/371/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
Ken Knoblauch knoblauch at lyon.inserm.fr writes: I remember that my father had a French curve: it was a plastic template used for drawing which had several smooth edges of varying curvature. Yes. These were used by graphic artists, among others. Some pictures of these are posted at http://mathworld.wolfram.com/FrenchCurve.html Along with a cute anecdote about the use of the French curve by physicist Richard Feynman. [ rest deleted ] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
On 01-Apr-05 Martyn Plummer wrote: On Fri, 2005-04-01 at 09:30 +0200, Martin Maechler wrote: dream == dream home [EMAIL PROTECTED] on Wed, 30 Mar 2005 12:27:08 -0800 writes: dream Dear R experts, Did someone implemented French Curve dream yet? Or can anyone point me some papers that I can dream follow to implement it? Are you talking about splines ? I vaguely remember having read that in the distant past, splines were sometimes called French curves. I found this: G. Wahba and S. Wold, A completely automatic french curve: Fitting splines by cross validation, Commun. Statist., vol. 4, no. 1, pp. 1-17, 1975. I remember that my father had a French curve: it was a plastic template used for drawing which had several smooth edges of varying curvature. You could use it to draw a wide variety of curved shapes. No doubt the French called it something else. I still have some, from the 1950s ... The curves in the edges are supposed to be segments of logarithmic spirals (which ensures a kind of self-similarity on different scales). A nice picture is at http://missourifamilies.org/learningopps/ learnmaterial/tools/frenchcurves.htm Splines, in the drawing-office sense, were long narrow (about 1/4 inch wide) strips of thin springy metal with, along their length, little flanges at right-angles to the plane of the strip. Each little flange had a hole in it. The principle was that you would pinthe flanges to the drawing-board at chosen points by pushing drawing-pins through the holes. The metal strip then stood up at a right-angle to the paper. The flanges were attached in such a way that you could slide them along the metal strip. (Or you could use a strip without flanges, and special pins which raised little pillars up from the paper, against which the spline would press.) The end result was that the metal strip then defined a curve on the paper, and you could run a pencil along it and draw a curve on the paper (taking care not to press too hard against the metal, to avoid deforming the curve). By virtue of the laws of elasticity, the curve delineated by the metal strip had a continuous second derivative, i.e. what modern kids call a second-derivative-continuous piecewise cubic spline. We have not moved on. Happy whatever it is to all, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 01-Apr-05 Time: 20:07:59 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] French Curve
Here is what my colleague dug up and his reaction to it, afterwards, and then one of mine: Pistolet, nom masculin DESSIN. Instrument de tracé permettant de dessiner les lignes courbes dans les tracés géométriques. Synon. curvigraphe, virgule. Les outils de l'écrivain plumiste sont: la plume, le tire-ligne, le compas (...) le balustre pour tous les petits cercles, (...) un jeu de pistolets (CHELET, Lithogr., 1933, p.58). Un compas, un compas de réduction, un curvigraphe, un pistolet de dessinateur, en sont des exemples (...) simples [de «machine» à interpolation] (RUYER, Cybern., 1954, p.43). J'aurai utilisé curvigraphe I seem to recall that when I first read about cubic splines, the splines on which they were based were flexible curves that were made to pass through knots (or ducks, I think), not at all like the rigid French curve. ken Quoting Liaw, Andy [EMAIL PROTECTED]: From: Ken Knoblauch I remember that my father had a French curve: it was a plastic template used for drawing which had several smooth edges of varying curvature. You could use it to draw a wide variety of curved shapes. No doubt the French called it something else. Nobody, up and down the corridor here, of age to have used one, could think of a name, but we looked it up in a universal French dictionary on the web, and it came up with ``un pistolet''. I recall reading: E.J. Wegman and I.W. Wright. Splines in Statistics. Journal of the American Statistical Association, vol 78, N382, 1983. which mentioned `spline' as a tool that draftsmen used to draw curves, but the description does not match the french curve I know, which _is_ a template-like piece of various curvature. (I used one of these in the year I spent in Architechture school right after high school. No, I not _that_ old... I believe they are still in common used today.) Andy Ken Knoblauch Inserm U371, Cerveau et Vision Department of Cognitive Neurosciences 18 avenue du Doyen Lepine 69675 Bron cedex France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: 06 84 10 64 10 http://www.lyon.inserm.fr/371/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Notice: This e-mail message, together with any attachment...{{dropped}} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
On Fri, 2005-04-01 at 20:07 +0100, [EMAIL PROTECTED] wrote: snip I still have some, from the 1950s ... The curves in the edges are supposed to be segments of logarithmic spirals (which ensures a kind of self-similarity on different scales). A nice picture is at http://missourifamilies.org/learningopps/ learnmaterial/tools/frenchcurves.htm Splines, in the drawing-office sense, were long narrow (about 1/4 inch wide) strips of thin springy metal with, along their length, little flanges at right-angles to the plane of the strip. Each little flange had a hole in it. The principle was that you would pinthe flanges to the drawing-board at chosen points by pushing drawing-pins through the holes. The metal strip then stood up at a right-angle to the paper. The flanges were attached in such a way that you could slide them along the metal strip. (Or you could use a strip without flanges, and special pins which raised little pillars up from the paper, against which the spline would press.) The end result was that the metal strip then defined a curve on the paper, and you could run a pencil along it and draw a curve on the paper (taking care not to press too hard against the metal, to avoid deforming the curve). By virtue of the laws of elasticity, the curve delineated by the metal strip had a continuous second derivative, i.e. what modern kids call a second-derivative-continuous piecewise cubic spline. We have not moved on. Happy whatever it is to all, Ted. Ted, That sounds like the flexible curves that I found earlier, while Googling for an example of a French Curve and found the Mathworld link: http://www.artsupply.com/alvin/curves.htm and http://www.reuels.com/reuels/product21021.html Marc __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
On 01-Apr-05 Marc Schwartz wrote: On Fri, 2005-04-01 at 20:07 +0100, [EMAIL PROTECTED] wrote: snip [...] Splines, in the drawing-office sense, were long narrow (about 1/4 inch wide) strips of thin springy metal with, along their length, little flanges at right-angles to the plane of the strip. Each little flange had a hole in it. The principle was that you would pinthe flanges to the drawing-board at chosen points by pushing drawing-pins through the holes. The metal strip then stood up at a right-angle to the paper. The flanges were attached in such a way that you could slide them along the metal strip. (Or you could use a strip without flanges, and special pins which raised little pillars up from the paper, against which the spline would press.) The end result was that the metal strip then defined a curve on the paper, and you could run a pencil along it and draw a curve on the paper (taking care not to press too hard against the metal, to avoid deforming the curve). By virtue of the laws of elasticity, the curve delineated by the metal strip had a continuous second derivative, i.e. what modern kids call a second-derivative-continuous piecewise cubic spline. We have not moved on. Happy whatever it is to all, Ted. Ted, That sounds like the flexible curves that I found earlier, while Googling for an example of a French Curve and found the Mathworld link: http://www.artsupply.com/alvin/curves.htm and http://www.reuels.com/reuels/product21021.html Marc Not quite, I think, Marc. The principle of the spline as I described it meant that the shape of the curve between the fixed points was the static-equilibrium shape determined by the elasticity of the metal (though some kinds were also made of thin strips of laminated wood, but worked on the same principle). They were therefore typically used for interpolating mathematically between given points. The curves shown on those web-site operate differently: they are simply flexible, and can be bent by hand to any shape, rather like modelling clay, which they then hold by virtue of how they are constructed (see especially the description on the 'artsupply' website: the lead core gives the mouldability and was not springy, and the outer plastic covering makes them smoother to use). (I've used these too, once upon a time). Best wishes, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 01-Apr-05 Time: 22:53:17 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] French Curve
On Fri, 2005-04-01 at 22:56 +0100, [EMAIL PROTECTED] wrote: On 01-Apr-05 Marc Schwartz wrote: On Fri, 2005-04-01 at 20:07 +0100, [EMAIL PROTECTED] wrote: snip [...] Splines, in the drawing-office sense, were long narrow (about 1/4 inch wide) strips of thin springy metal with, along their length, little flanges at right-angles to the plane of the strip. Each little flange had a hole in it. The principle was that you would pinthe flanges to the drawing-board at chosen points by pushing drawing-pins through the holes. The metal strip then stood up at a right-angle to the paper. The flanges were attached in such a way that you could slide them along the metal strip. (Or you could use a strip without flanges, and special pins which raised little pillars up from the paper, against which the spline would press.) The end result was that the metal strip then defined a curve on the paper, and you could run a pencil along it and draw a curve on the paper (taking care not to press too hard against the metal, to avoid deforming the curve). By virtue of the laws of elasticity, the curve delineated by the metal strip had a continuous second derivative, i.e. what modern kids call a second-derivative-continuous piecewise cubic spline. We have not moved on. Happy whatever it is to all, Ted. Ted, That sounds like the flexible curves that I found earlier, while Googling for an example of a French Curve and found the Mathworld link: http://www.artsupply.com/alvin/curves.htm and http://www.reuels.com/reuels/product21021.html Marc Not quite, I think, Marc. The principle of the spline as I described it meant that the shape of the curve between the fixed points was the static-equilibrium shape determined by the elasticity of the metal (though some kinds were also made of thin strips of laminated wood, but worked on the same principle). They were therefore typically used for interpolating mathematically between given points. The curves shown on those web-site operate differently: they are simply flexible, and can be bent by hand to any shape, rather like modelling clay, which they then hold by virtue of how they are constructed (see especially the description on the 'artsupply' website: the lead core gives the mouldability and was not springy, and the outer plastic covering makes them smoother to use). (I've used these too, once upon a time). Best wishes, Ted. Ted, Thanks for the clarification. I think that I have a better mind's eye view of the differences, combining your additional comments with your initial explanation. The mention of laminated wood clicked and took my mind back to some physics experiments with bi-metals... Regards, Marc __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] French Curve
Dear R experts, Did someone implemented French Curve yet? Or can anyone point me some papers that I can follow to implement it? thanks in advance for your help. Paul __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html