similar to: Error message

Displaying 20 results from an estimated 900 matches similar to: "Error message"

2013 Mar 21
1
"adaptIntegrate" function
Hi all, it seems that there is problem with function "adaptIntegrate", when the integration limits is infinity. Please see the code below. The second integration does not seem to work. Can anyone familiar with this give some help? Thank you with much. Hanna library(mnormt) library(cubature) ff <- function(x, rho){ mu <- rep(0,3) Sigma
2011 Nov 10
2
performance of adaptIntegrate vs. integrate
Dear list, [cross-posting from Stack Overflow where this question has remained unanswered for two weeks] I'd like to perform a numerical integration in one dimension, I = int_a^b f(x) dx where the integrand f: x in IR -> f(x) in IR^p is vector-valued. integrate() only allows scalar integrands, thus I would need to call it many (p=200 typically) times, which sounds suboptimal. The
2013 Feb 15
1
minimizing a numerical integration
Dear all, I am a new user to R and I am using pracma and nloptr libraries to minimize a numerical integration subject to a single constraint . The integrand itself is somehow a complicated function of x and y that is computed through several steps. i formulated the integrand in a separate function called f which is a function of x &y. I want to find the optimal value of x such that the
2011 May 03
2
adaptIntegrate - how to pass additional parameters to the integrand
Hello, I am trying to use adaptIntegrate function but I need to pass on a few additional parameters to the integrand. However, this function seems not to have the flexibility of passing on such additional parameters. Am I missing something or this is a known limitation. Is there a good alternative to such restrictions, if there at all are? Many thanks for your time. HC -- View this message in
2012 Oct 02
3
Integration in R
Dear R-users, I am facing problem with integrating in R a likelihood function which is a function of four parameters. It's giving me the result at the end but taking more than half an hour to run. I'm wondering is there any other efficient way deal with. The following is my code. I am ready to provide any other description of my function if you need to move forward.
2010 Sep 21
3
bivariate vector numerical integration with infinite range
Dear list, I'm seeking some advice regarding a particular numerical integration I wish to perform. The integrand f takes two real arguments x and y and returns a vector of constant length N. The range of integration is [0, infty) for x and [a,b] (finite) for y. Since the integrand has values in R^N I did not find a built-in function to perform numerical quadrature, so I wrote my own after
2012 May 23
0
Error from using adaptIntegrate within a function that is then integrated
I want to measure the error in the estimation of a 2 dimensional density function that is calculated using an integral but run into problems trying to integrate with adaptIntegrate because the integrand also calls the function adaptIntegrate. In particular I want \int \hat{f}(x,y) - f(x,y) dx dy where \hat{f}(x,y) = \int K(a,b, x, y) da db and in this simulation study I know what the true value
2010 Dec 15
1
pmnorm: probabilites don't sum up to 1
Dear list member, I struggle with the problem, why the probabilities of choosing one of three mutually exclusive alternatives don?t sum up to 1! Let?s assume we have three alternatives X, Y, and Z. Let?s further assume we know their respective utilities: uX, uY, uZ. I?m interested in calculating the probability of choosing X, Y, and Z. Since I assume that the alternatives are mutually
2008 Feb 19
1
recursive function help
I'm trying to implement a recursive function using integrate, and I suspect I need a Vectorize somewhere, but I can't suss it out. Any help would be appreciated. I've tried traceback() and various debugging ideas to no avail (most likely due to my inexperience with these tools.) Here's what I have. Nk <- function(m, C) { if (length(m) > 1) { rho <- C[1, -1]
2011 Mar 04
2
overleap an iteration within a for-loop when error message produced
Dear R-list member, I'm using the function pmnorm() (-->library(mnormt)) within a for-loop. Certain parameter values leads to an error message: "(In sqrt(diag(S)) : NaNs produced, In sqrt(1/diag(V)) : NaNs produced, In cov2cor(S) : diag(.) had 0 or NA entries; non-finite result is doubtful)" obviously because "NaNs" were produced. Is it possible to tell R that it
2018 Feb 06
2
question with integrate function
Hi all, The function h below is a function of c and it should be a monotone increasing function since the integrand is nonnegative and integral is taken from c to infinity. However, as we can see from the plot, it is not shown to be monotone. Something wrong with the usage of integrate function? Thanks so much for your help. Hanna h <- function(c){ g <- function(x){pnorm(x-8.8,
2008 Aug 26
2
Problem with Integrate for NEF-HS distribution
I need to calcuate the cumulative probability for the Natural Exponential Family - Hyperbolic secant distribution with a parameter theta between -pi/2 and pi/2. The integration should be between 0 and 1 as it is a probability. The function "integrate" works fine when the absolute value of theta is not too large. That is, the NEF-HS distribution is not too skewed. However, once the
2010 Dec 22
3
How to integrate a function with additional argument being a vector or matrix?
Dear expeRts, I somehow don't see why the following does not work: integrand <- function(x, vec, mat, val) 1 # dummy return value A <- matrix(runif(16), ncol = 4) u <- c(0.4, 0.1, 0.2, 0.3) integrand(0.3, u, A, 4) integrate(integrand, lower = 0, upper = 1, vec = u, mat = A, val = 4) I would like to integrate a function ("integrand") which gets an "x" value (the
2013 Feb 12
2
integrate function
Hi All, Can any one help to explain why min and max function couldn't work in the integrate function directly. For example, if issue following into R: integrand <- function(x) {min(1-x, x^2)} integrate(integrand, lower = 0, upper = 1) it will return this: Error in integrate(integrand, lower = 0, upper = 1) : evaluation of function gave a result of wrong length However, as min(U,V) =
2018 Feb 06
0
question with integrate function
Sorry. I meant in the previous email that the function h() is a monotone decreasing function. Thanks very much. 2018-02-06 13:32 GMT-05:00 li li <hannah.hlx at gmail.com>: > Hi all, > The function h below is a function of c and it should be a monotone > increasing function since the integrand is nonnegative and integral is > taken from c to infinity. However, as we can see
2018 Feb 06
1
question with integrate function
Hi Hanna, your function is essentially zero outside a short interval around 9. And the help page states: "If the function is approximately constant (in particular, zero) over nearly all its range it is possible that the result and error estimate may be seriously wrong." You could try to integrate over a finite interval, say (7, 12). G?ran Brostr?m On 2018-02-06 19:40, li li wrote:
2011 Jun 25
1
integration function
Hi all, Can anyone please take a look at the following two functions. The answer does not seem to be right. Thank you very much! f1 <- function(x) {integrand <- function (x, mu){ dnorm(x, mean=mu, sd=1)*dnorm(mu, mean=2, sd=1) } integrate(integrand, -Inf, Inf,x)$val } f2 <- function(x) {integrand <- function (x, mu){
2011 May 30
1
Error in minimizing an integrand using optim
Hi, Am not sure if my code itself is correct. Here's what am trying to do: Minimize integration of a function of gaussian distributed variable 'x' over the interval qnorm(0.999) to Inf by changing value of parameter 'mu'. mu is the shift in mean of 'x'. Code: # x follows gaussian distribution # fx2 to be minimized by changing values of mu # integration to be done over
2002 Jun 28
1
integrate function fails! (PR#1718)
Full_Name: José Enrique Chacón Version: 1.5.0 and 1.3.1 OS: Windows Millenium Submission from: (NULL) (158.49.28.155) Dear reader: I was trying to evaluate the L2 error produced when estimating the density function N(0,1) from a sample of size 100 using a kernel density estimate. It produced a strange value. You can reproduce the process by typing samp<-rnorm(100)
2010 Feb 09
1
how to adjust the output
Hi R-users,   I have this code below and I understand the error message but do not know how to correct it.  My question is how do I get rid of “with absolute error < 7.5e-06” attach to value of cdf so that I can carry out the calculation.   integrand <- function(z) { alp  <- 2.0165   rho  <- 0.868   # simplified expressions   a      <- alp-0.5   c1     <-