Displaying 6 results from an estimated 6 matches for "rootfinding".
2018 Jul 30
2
trace in uniroot() ?
In looking at rootfinding for the histoRicalg project (see gitlab.com/nashjc/histoRicalg),
I thought I would check how uniroot() solves some problems. The following short example
ff <- function(x){ exp(0.5*x) - 2 }
ff(2)
ff(1)
uniroot(ff, 0, 10)
uniroot(ff, c(0, 10), trace=1)
uniroot(ff, c(0, 10), trace=TRUE)
shows th...
2018 Aug 13
1
trace in uniroot() ?
...tprocessing can ususally figure that out.
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com <http://tibco.com>
>
> On Mon, Jul 30, 2018 at 11:35 AM, J C Nash <profjcnash at gmail.com <mailto:profjcnash at gmail.com>> wrote:
>
> In looking at rootfinding for the histoRicalg project (see gitlab.com/nashjc/histoRicalg
> <http://gitlab.com/nashjc/histoRicalg>),
> I thought I would check how uniroot() solves some problems. The following short example
>
> ff <- function(x){ exp(0.5*x) - 2 }
> ff(2)
> ff(1)...
2007 Oct 27
1
Newton method iteration problem
...em. Thanks.
# code
#generate target function (phi(x)-alpha) (allow input x and alpha)
target<-function(x,alpha){
pnorm(x)-alpha
}
#generate the first derivative of the of the target function
firstDerivative<-function(x){
exp(-(x^2)/2)/sqrt(2*pi)
}
# Finding the root by Newton method
rootFinding<-function(initialX,setAlpha){
while(target(initialX,setAlpha)!=0){
initialX<-initialX-(target(initialX,setAlpha)/firstfirstDerivative(initialX)
}
initialX
}
--
View this message in context: http://www.nabble.com/Newton-method-iteration-problem-tf4701085.html#a13439031
Sent from the R help...
2018 Aug 13
0
trace in uniroot() ?
...function is being called (e.g. in
a line search
or in derivative estimation), but some plotting or other postprocessing can
ususally figure that out.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Jul 30, 2018 at 11:35 AM, J C Nash <profjcnash at gmail.com> wrote:
> In looking at rootfinding for the histoRicalg project (see
> gitlab.com/nashjc/histoRicalg),
> I thought I would check how uniroot() solves some problems. The following
> short example
>
> ff <- function(x){ exp(0.5*x) - 2 }
> ff(2)
> ff(1)
> uniroot(ff, 0, 10)
> uniroot(ff, c(0, 10), trace=1)...
2017 Nov 07
0
Fitdistrplus and Custom Probability Density
Why not define your own functions based on d?
e.g.
myCumDist <- function(x) { integrate(d, lower=-Inf, upper=x)$value }
myQuantile <- function(x) { uniroot(f=function(y) { h(y) - x },
interval=c(-5,5)) } # limits -5,5 should be replaced by your own which
might require some fiddling
e.g.
d <- function(x) { exp(-x^2/2)/(sqrt(2*pi)) } # just an example for you to
test with; use your own
2017 Nov 07
2
Fitdistrplus and Custom Probability Density
Dear All,
Apologies for not providing a reproducible example, but if I could, then I
would be able to answer myself my question.
Essentially, I am trying to fit a very complicated custom probability
distribution to some data.
Fitdistrplus does in principle everything which I need, but if require me
to specify not only the density function d, but also the cumulative p and
and inverse cumulative