similar to: R2Cuba package, failed with message ‘Dimension out of range’

Displaying 20 results from an estimated 1000 matches similar to: "R2Cuba package, failed with message ‘Dimension out of range’"

2011 Dec 06
2
configuring a package for own personal needs
Hi All, There is a function in package "R2Cuba" called Cuhre that I need to use. It keeps spitting out a new-line which I really dont want it to do. So I was wondering what is the best way of configuring the package. I tried copying and pasting the code into Cuhre2 and getting rid of the newline command BUT that didn't work since it seems to have some private functions which I do
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
2012 Mar 13
1
Two dimensional integration
Dear R Members, I want to know a fast R function to do multidimensional integration. I used the function 'cuhre' in R2cuba library. But it takes painful time to get the answer. I would be thankful if anyone could help me out to solve this problem Thanks Niroshan -- View this message in context: http://r.789695.n4.nabble.com/Two-dimensional-integration-tp4468282p4468282.html Sent
2012 Mar 25
1
cubature
Hi, I am using adaptIntegrate from Cubature to do numerical integration on a double integral with a 1 x 2 vector x. Say the function is something simple to start like f(x)=x1*x2 and I wish to integrate x1 over (0,365-x2) and x2 over (0,365) f <- function(x) {(x[2])*(x[1])} # "x" is vector int1<-adaptIntegrate(f, lowerLimit = c(0, 0), upperLimit = c(365-x[2], 365)) I recieve
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
2013 Jan 08
2
Integration in R
Hi R-users. I'm having difficulty with an integration in R via the package "cubature". I'm putting it with a simple example here. I wish to integrate a function like: f(x1,x2)=2/3*(x1+x2) in the interval 0<x1<x2<7. To be sure I tried it by hand and got 114.33, but the following R code is giving me 102.6667.
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
2011 Mar 29
5
Integration with variable bounds
If this is posted elsewhere I cannot find it. I need to perform multiple integration where some of the variables are in the bounds of the other variables. I was trying to use R2Cuba function but cannot set the upper and lower bounds. My code so far is : int <- function(y){ u2 = y[1] z2 = y[2] u1 =y[3] z1 = y[4] ff <- u1*(z1-u1)*u2*(z2-u2)*exp(-0.027*(12-z2)) return(ff) }
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
2011 Oct 05
2
cuhre usage ?? multidimensional integration
my=function(x){ len=1 for(i in 1:len){ y[i]=x[i] } g=1 w=NULL t=NULL for(i in 1:len)w[i]=x[i+len] for(i in 1:len)t[i]=x[i+2*len] for(i in 1:len)g=g*dnorm(y[i])*dnorm(w[i])*dnorm(z[i]) return(g) } cuhre(6,1,my,rep(-100,6),rep(100,6)) Error in crff(match.call(), integrand, "cuhre", libargs, ...) : Additional argument not expected in the integrand function function change to
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 21
0
Erratic error with adaptIntegrate in cubature package
Hi everyone, I have been using adaptIntegrate from the cubature package for a multidimensional integral that has infinite variance (and so not appropriate for Monte Carlo techniques). Most of the time it works but sometimes (though not always) when I slightly increase the accuracy I want, or increase the bounds of integration I get the following error: REAL() can only be applied to a
2013 Feb 16
3
two dimensional integration
Dear R-users, I'm wondering how to calculate this double integral in R: int_a^b int_c^y g(x, y) dx dy where g(x,y) = exp(- alpha (y - x)) * b Thanks for answering! Cheers, Alui [[alternative HTML version deleted]]
2013 Apr 22
2
numerical integration of a bivariate function
hello I work on the probabilities of bivariate normal distribution. I need integrate  the following function. f (x, y) = exp [- (x ^ 2 + y ^ 2 + x * y)] with - ∞ ≤ x ≤ 7.44 and - ∞ ≤ y ≤ 1.44   , either software R or  matlab Version R 2009a Thank you for helping me Regards Mezouara hicham PhD in Metrology Hicham_dess @ yahoo.fr [[alternative HTML version deleted]]
2011 Jun 18
1
double integral calculation
a=[0.1,0.2,0.1,0.3,0.4] b=[0.2,0.3,0.1,0.2,0.5] c=[1,1,1,1,1] log(c+a-x*b) where x=unknown scale variable. int=$$log(c+a-x*b)dadb, where $ denotes integral sign. Actually, how could I calculate the integral's approximation? double summation? best, moohwan
2010 Jun 18
2
double integral
Sir, I want to calculate double integral in R. Is there any function to do this? Regards, Suman Dhara [[alternative HTML version deleted]]
2010 Jul 01
3
Double Integration
Dear R helpers I am working on the Bi-variate Normal distribution probabilities. I need to double integrate the following function (actually simplified form of bivariate normal distribution) f(x, y) = exp [ - 0.549451 * (x^2 + y^2 - 0.6 * x * y) ] where 2.696 < x < 3.54 and -1.51 < y < 1.98 I need to solve something like INTEGRATE (2.696 to 3.54) dx INTEGRATE [(-1.51 to 1.98)]
2013 Mar 05
2
Error message
Dear all, I got an error message when running the following code. Can anyone give any suggestions on fixing this type of error? Thank you very much in advance. Hanna > integrand <- function(x, rho, a, b, z){ + x1 <- x[1] + x2 <- x[2] + Sigma <- matrix(c(1, rho, rho, 1), 2,2) + mu <- rep(0,2) + f <-
2012 Mar 23
3
R numerical integration
Hi all, Is there any other packages to do numerical integration other than the default 'integrate'? Basically, I am integrating: integrate(function(x) dnorm(x,mu,sigma)/(1+exp(-x)),-Inf,Inf)$value The integration is ok provided sigma is >0. However, when mu=-1.645074 and sigma=17535.26 It stopped working. On the other hand, Maple gives me a value of 0.5005299403. It is an