# [R] Smooth monotone estimation on R

Eliyahu-Oron assaf at u.washington.edu
Wed Jul 14 16:06:14 CEST 2004

```Andy, Kjetil, hi,

I figured out how to run this, after visiting Jim Ramsay's FDA webpage
example on monotone smoothing:
http://ego.psych.mcgill.ca/misc/fda/ex-growth-d1.html

The code there is Matlab, using very similar names to the R names.

First one needs to create a 'blank' B-spline object (using
create.bspline.basis(), then data2fd() with a 'blank' data vector of, say,
zeros).
Then this object is used as the 'Wfdobj' argument in 'smooth.monotone()'.
The smoothing spline version (lambda=some positive constant) seems to work
better than non-penalized splines (lambda=0).
So the command would be
solution<-smooth.monotone(x,y,Wfdobj=createdbspline,lambda=0.1)

The fit may be shown using
fitted<-solution\$beta[1]+solution\$beta[2]*eval.monfd(xx,solution\$Wfdobj).

eval.monfd() is a utility to perform the integration on the exponent of the
'embedded' B-spline object.

Algebraic details do appear in the 'smooth.monotone()' help, and also on the
webpage.

Ramsay's approach seems to be the one most 'popular' in literature at the
moment, so I'll probably use this package a lot over the next few weeks. If
someone can't access Jim Ramsay or some other 'FDA insider', you can
probably forward them to me regarding smooth.monotone().

Thanks so much again,

Assaf

-----Original Message-----
From: Liaw, Andy [mailto:andy_liaw at merck.com]
Sent: Wednesday, July 14, 2004 6:17 AM
To: 'Kjetil Halvorsen'; Eliyahu-Oron
Cc: R-help at stat.math.ethz.ch
Subject: RE: [R] Smooth monotone estimation on R

Browsing over the FDA book, I can not find any discussion of monotone
smoothing.

Andy

> From: Kjetil  Halvorsen
>
> Hola!
>
> Experimenting a little, package fda seems very much under
> development,
> and help pages are definitely not finished.
> It would certainly help to read the book "functional data
> analysis" by
> the author of fda, which is in our library.
> On the other hand package mgcv is more mature, so it would
> seem easier
> to use that.
>
> It is not totally automatic, but the example
> library(mgcv)
> example(mono.con)
>
> has everything necessary to get started.
>
> Kjetil Halvorsen
>
> Eliyahu-Oron wrote:
>
> >Kjetil and Andy,
> >
> fda) seem to be in
> >
> >I'm running into a lot of implementation difficulties,
> though. I wonder if
> >there's anyone who tried to do a monotone spline using
> either the 'mgcv' or
> >the 'fda' packages, whom I could ask directly?
> >
> >Thanks again, Assaf
> >
> >-----Original Message-----
> >From: Kjetil Halvorsen [mailto:kjetil at acelerate.com]
> >Sent: Monday, July 12, 2004 4:32 PM
> >To: Assaf P Oron
> >Cc: R-help at stat.math.ethz.ch
> >Subject: Re: [R] Smooth monotone estimation on R
> >
> >
> >help.search()
> >on my machine turns up only:
> >
> >mono.con(mgcv)          Monotonicity constraints for a cubic
> >                        regression spline.
> >
> >smooth.monotone(fda)    Monotone Smoothing of Data
> >pmreg(ftnonpar)         Piecewise monotone regression with taut
> >                        strings
> >backSpline(splines)     Monotone Inverse Spline
> >isoreg(stats)           Isotonic / Monotone Regression
> >
> >so you should find something of use in packages mgvc, fda,
> ftnonpar, splines
> >or stats (.loaded by default)
> >
> >Kjetil Halvorsen
> >
> >
> >Assaf P Oron wrote:
> >
> >
> >
> >>Hi all,
> >>
> >>I'm looking for smooth monotone estimation packages,
> preferably using
> >>
> >>
> >splines.
> >
> >
> >>I downloaded the 'cobs' package and intend to use it, but
> since it offers
> >>
> >>
> >only quadratic splines based on L1 minimization, I'd like to
> compare its
> >performance to that of a more 'mainstream' cubic-spline,
> L2-norm minimizing
> >spline. Preferably a smoothing spline.
> >
> >
> >>Does anyone know of such code existing anywhere? Or another
> smooth monotone
> >>
> >>
> >alternative?
> >
> >
> >>
> >>Assaf Oron
> >>Statistics Department
> >>University of Washington
> >>
> >>______________________________________________
> >>R-help at stat.math.ethz.ch mailing list
> >>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >>
> >>
> >http://www.R-project.org/posting-guide.html
> >
> >
> >>
> >>
> >>
> >>
> >
> >______________________________________________
> >R-help at stat.math.ethz.ch mailing list
> >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> http://www.R-project.org/posting-guide.html
> >
> >
> >
> >
>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> http://www.R-project.org/posting-guide.html
>
>

----------------------------------------------------------------------------
--
Notice:  This e-mail message, together with any attachments,...{{dropped}}

```