similar to: what is the purpose of an error message in uniroot?

Displaying 20 results from an estimated 2000 matches similar to: "what is the purpose of an error message in uniroot?"

2013 May 30
2
RFC: a "safe" uniroot() function for future R
With main R releases only happening yearly in spring, now is good time to consider *and* discuss new features for what we often call "R-devel" and more officially is R Under development (unstable) (.....) -- "Unsuffered Consequences" Here is one such example I hereby expose to public scrutiny: A few minutes ago, I've committed the following to R-devel (the
2011 May 06
1
Uniroot - error
Hi, I have tried to use uniroot to solve a value (value a in my function) that gives f=0, and I repeat this process for 10000 times(stimulations). However error occures from the 4625th stimulation - Error in uniroot(f, c(0, 2), maxiter = 1000, tol = 0.001) : f() values at end points not of opposite sign I have also tried interval of (lower=min(U), upper=max(U)) and it won't work as well.
2023 Feb 18
1
uniroot violates bounds?
I wrote first cut at unirootR for Martin M and he revised and put in Rmpfr. The following extends Ben's example, but adds the unirootR with trace output. c1 <- 4469.822 c2 <- 572.3413 f <- function(x) { c1/x - c2/(1-x) }; uniroot(f, c(1e-6, 1)) uniroot(f, c(1e-6, 1)) library(Rmpfr) unirootR(f, c(1e-6, 1), extendInt="no", trace=1) This gives more detail on the iterations,
2023 Feb 20
1
uniroot violates bounds?
Le 18/02/2023 ? 21:44, J C Nash a ?crit?: > I wrote first cut at unirootR for Martin M and he revised and put in > Rmpfr. > > The following extends Ben's example, but adds the unirootR with trace > output. > > c1 <- 4469.822 > c2 <- 572.3413 > f <- function(x) { c1/x - c2/(1-x) }; uniroot(f, c(1e-6, 1)) > uniroot(f, c(1e-6, 1)) > library(Rmpfr) >
2008 Apr 12
1
R and Excel disagreement - Goal Seek versus uniroot
Dear friends - occurring in Windows R2.6.2 I am modeling physical chemistry in collaboration with a friend who has preferred working in Excel. I used uniroot, and find a solution to a two buffer problem in acid-base chemistry which I believe is physiologically sensible. Using "goal seek" in Excel my friend found another plausible root, quite close to zero, and a plot of the function
2011 Apr 03
1
How do I modify uniroot function to return .0001 if error ?
I am calling the uniroot function from inside another function using these lines (last two lines of the function) : d <- uniroot(k, c(.001, 250), tol=.05) return(d$root) The problem is that on occasion there's a problem with the values I'm passing to uniroot. In those instances uniroot stops and sends a message that it can't calculate the root because f.upper * f.lower is greater
2005 Mar 09
3
problem using uniroot with integrate
Hi, I'm trying to calculate the value of the variable, dp, below, in the argument to the integral of dnorm(x-dp) * pnorm(x)^(m-1). This corresponds to the estimate of the sensitivity of an observer in an m-alternative forced choice experiment, given the probability of a correct response, Pc, a Gaussian assumption for the noise and no bias. The function that I wrote below gives me an error:
2012 Nov 01
1
What does uniroot return when an error occurs
Hi, I'm using the uniroot function, and would like to detect an error which occurs, for instance, when the values at endpoints are not of opposite signs. For example: uniroot( function(x) x^2+1, lower=1, upper=2 ). I want to say something like: if "error in uniroot(...)" return NA else return uniroot$root Thanks a lot! Asaf -- View this message in context:
2020 Oct 06
0
Solving a simple linear equation using uniroot give error object 'x' not found
On 06/10/2020 11:00 a.m., Sorkin, John wrote: > Colleagues, > I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, > Error in yfu n(x,10,20) : object 'x' not found. > > I hope someone can tell we how I can fix
2011 Apr 02
1
uniroot speed and vectorization?
curiosity---given that vector operations are so much faster than scalar operations, would it make sense to make uniroot vectorized? if I read the uniroot docs correctly, uniroot() calls an external C routine which seems to be a scalar function. that must be slow. I am thinking a vectorized version would be useful for an example such as of <- function(x,a) ( log(x)+x+a ) uniroot( of, c(
2012 Jun 22
4
Uniroot error message with in intergration
Dear all I am trying to calculate the value of n using uniroot. Here is the message I am having: <<< Error in uniroot(integ, lower = 0, upper = 1000, n) : 'interval' must be a vector of length 2 >>> Please would you be able to give me an indication on why I am having this error message. Many thanks EXAMPLE BELOW: ## t = statistics test from t -distribution
2011 Dec 14
1
uniroot function question
I have one equation, two unknowns, so I am trying to build the solution set by running through possible values for one unknown, and then using uniroot to solve for the accompanying second solution, then graphing the two vectors. p0 = .36 f = function(x) 0.29 * exp(5.66*(x - p0)) f.integral = integrate(f, p0, 1) p1 = p0 + .01 i = 1 n = (1 - p0)/.01 p1.vector = rep(0,n) p2.vector = rep(0,n) for (i
2012 Apr 07
1
Uniroot error
Dear All I am trying to find a uniroot of a function within another function (see example) but I am getting an error message (f()values at end points not of opposite sign). I was wondering if you would be able to advise how redefine my function so that I can find the solution. In short my first function calculates the intergrale which is function of "t" , I need to find the uniroot of
2008 Dec 31
1
uniroot() problem
I have a strange problem with uniroot() function. Here is the result : > uniroot(th, c(-20, 20)) $root [1] 4.216521e-05 $f.root [1] 16.66423 $iter [1] 27 $estim.prec [1] 6.103516e-05 Pls forgive for not reproducing whole code, here my question is how "f.root" can be 16.66423? As it is finding root of a function, it must be near Zero. Am I missing something? -- View this message
2020 Oct 06
4
Solving a simple linear equation using uniroot give error object 'x' not found
Colleagues, I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, Error in yfu n(x,10,20) : object 'x' not found. I hope someone can tell we how I can fix the problem
2006 Jul 29
1
uniroot
Hello, I am struggling to find the root of a exponent function. "uniroot" is complaining about a values at end points not of opposite sign? s<- sapply(1:length(w),function(i) + { + + + + + uniroot(saeqn,lower=-5000,upper=0.01036597923,l=list(t=w[i],gp=gp))$root + }) Error in uniroot(saeqn, lower = -5000, upper = 0.01036597923, l = list(t = w[i], : f() values at
2007 Mar 29
1
ansari.test.default: bug in call to uniroot?
A recent message on ansari.test() prompted me to play with the examples. This doesn't work for me in R version 2.4.1 R> ansari.test(rnorm(100), rnorm(100, 0, 2), conf.int = TRUE) Error in uniroot(ab, srange, tol = 1e-04, zq = qnorm(alpha/2, lower = FALSE)) : object "ab" not found It looks like there's a small typo in ccia() inside ansari.test.default() in which
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 that the trace parameter, as described in the Rd file, does not seem to be
2018 Aug 13
1
trace in uniroot() ?
Despite my years with R, I didn't know about trace(). Thanks. However, my decades in the minimization and root finding game make me like having a trace that gives some info on the operation, the argument and the current function value. I've usually found glitches are a result of things like >= rather than > in tests etc., and knowing what was done is the quickest way to get there.
2011 Nov 14
2
how to include integrate in a function that can be solved with uniroot?
Hallo, I am trying to define expectation as an integral and use uniroot to find the distribution parameter for a given expectation. However I fail to understand how to define properly the functions involved and pass the parameters correctly. Can anyone help me out? Thanks, Gerrit Draisma. This what I tried: ======= > # exponential density > g <- function(x,lambda){ lambda