[R] Inverse function

Greg Snow Greg.Snow at imail.org
Thu Feb 25 21:51:11 CET 2010


?uniroot

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of li li
> Sent: Wednesday, February 24, 2010 2:31 PM
> To: Bert Gunter
> Cc: r-help
> Subject: Re: [R] Inverse function
> 
> This is not a homework problem.
> 
> How to solve numerically for y from f(y,r) - a=g(y)=0? I am not too
> sure.
> 
> Thanks!
>                        Hannah
> 
> 
> 2010/2/24 Bert Gunter <gunter.berton at gene.com>
> 
> > 1. Is this a homework problem?
> >
> > 2. Etiquette on this list is to sign with your full real name.
> Adhering to
> > the list etiquette may enhance your chance of a useful response,
> especially
> > in view of (1), as we (or at least some of us) do not wish to do
> students'
> > homework for them.
> >
> > 3. Hint: f(y,r) = a  <==>  g(y) = 0 where g(y) == f(y,r) - a
> > (for numerical solutions).
> >
> >
> > Bert Gunter
> > Genentech Nonclinical Biostatistics
> >
> >  -----Original Message-----
> > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org]
> > On
> > Behalf Of li li
> > Sent: Wednesday, February 24, 2010 12:46 PM
> > To: r-help
> > Subject: [R] Inverse function
> >
> > Hi all,
> >   I have a function like the following:
> >
> >      f <- function(r,
> > y){r/(2*pi)*exp(1)^(-y)*(1+r*(y/2)+r^(2)*(y-1)^(2)/6)}
> >
> > For fixed r, I want to find the inverse funtion in terms y.
> > In other words, for fixed r, if the value of the function is given, I
> want
> > to
> > find the corrsponding y value that will achieve the specific function
> > value.
> >
> > Can anyone help me?
> >            Hannah
> >
> >        [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html<http://www.r-
> project.org/posting-guide.html>
> > and provide commented, minimal, self-contained, reproducible code.
> >
> >
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list