Displaying 20 results from an estimated 400 matches similar to: "meaning of lenwrk value in adapt function"
2002 Jul 14
1
help with adapt function
Dear People,
I'm trying to use the function adapt, from the adapt library package,
which does multidimensional numerical integration. I think I must be using
the wrong syntax or something, because even a simple example does not
work. Consider
foo <- function(x){x[1]*x[2]}
and
adapt(2, lo = c(-1,-1), up = c(1,1), functn = foo)
This simply hangs. A more complicated example crashes R,
2007 Mar 28
1
warnings on adapt
Hi all
I was wondering if someone could help me.
I have to estimate some parameters, so I am using the function nlm. Inside
this function I have to integrate, hence
I am using the function adapt.
I don't understand why it is giving the following warnings:
At the beginning:
Warning: a final empty element has been omitted
the part of the args list of 'c' being evaluated was:
2001 Mar 08
1
inconsistent results when calling functions with other func (PR#869)
Hello Bug people,
I have an unexpected behavior and am unsure whether the problem is in my
thinking, my implementation or the program R.
Basically I get two different answers depending on how I call a function
which takes other functions as arguments as indicated below.
To me it should make no difference if f is a function that returns the
function g then z(f(x)) whould give the same as
y<-
2000 Jan 19
1
Segmentation fault using integrate()
Hi all,
Running R 0.90.1 on a RH 6.1 system. Installation of the
integrate_2.1-2 package went smoothly. My code contains a loop
in which integrate() is called several times in each pass.
I get a segmentation fault after what seems to be a random number
of calls to integrate(). Debug output shows:
Program received signal SIGSEGV, Segmentation fault.
promiseArgs (el=0x40276414,
2001 Jan 11
1
segmentation fault in integrate (PR#812)
I tried to integrate numerically a function wich is similar to the
following:
> dummy <- function(x) { exp(-1*x) * dnorm(x) }
> dummy(-100)
[1] 0
> dummy(-1000)
[1] NaN
> dummy(-10000)
[1] NaN
If I choose the lower boundary to be too small integrate causes a
segmentation fault:
> library(integrate)
> integrate(dummy, -100, 0)$value
[1] 1.387143
> integrate(dummy, -1000,
2006 May 05
2
double integral
Dear r-users,
Is there any command in R allowing to evaluate a double integral? for
instance let say I want to evaluate the following integral:
integrate[lo=(0,1),up=(2,3)] f(x,y)=x^2+y^2
where lo is the vector of lower bounds and up that of upper bounds.
I thaught the function "adapt" would work but it did not.
Many thanks,
Dominique K.
2005 Sep 05
3
numerical intergation
how does one numerically intergate the following:
A=function(x,y)
{
xy
}
over the range: 2<x<0 4<y<10
say.
ie how would one set up the integrate function?
i forgot!
2007 Feb 13
1
Multidimensional Integration over arbitrary sets
Hi,
I need to integrate a 2D function over range where the limits depend
on the other e.g integrate f(x,y)=x*y over {x,0,1} and {y,x,1}.
i.e \int_0^1 \int_x^1 xy dydx
I checked adapt but it doesn't seem to help here. Are they any
packages for this sort of thing?
I tried RSitesearch but couldn't find the answer to this.
Many thanks for you help.
Regards
Saptarshi
Saptarshi Guha
2004 Jul 27
1
Integration with "adapt"
Hi all,
I need to calculate a multidimensional integration on R. I am using the
command "adapt" (from library adapt), although sometimes I get the
following error message:
Ifail=2, lenwrk was too small. -- fix adapt() !
Check the returned relerr! in: adapt(3, linf, lsup, functn = Integrando1)
I guess it happens because the domain of integration is too small,
although I tried a
2007 Nov 14
0
R Crashes on certain calls of Adapt
I'm having trouble with adapt. I'm trying to use it in a Bayesian setting,
to integrate the posterior distribution, and to find posterior means. I
tried using the following script, and things went ok:
data = rnorm(100,0.2,1.1)
data = c(data,rnorm(10,3,1))
data = data[abs(data)<2*sd(data)]
prior = function(x){
dgamma(x[2],shape=2,scale=1)*dnorm(x[1],0,.5)
}
liklihood =
2006 Nov 18
1
Questions regarding "integrate" function
Hi there. Thanks for your time in advance.
I am using R 2.2.0 and OS: Windows XP.
My final goal is to calculate 1/2*integral of
(f1(x)^1/2-f2(x)^(1/2))^2dx (Latex codes:
$\frac{1}{2}\int^{{\infty}}_{\infty}
(\sqrt{f_1(x)}-\sqrt{f_2(x)})^2dx $.) where f1(x) and f2(x) are two
marginal densities.
My problem:
I have the following R codes using "adapt" package. Although "adapt"
2010 Feb 09
2
Double Integral Minimization Problem
Hello all,
I am trying to minimize a function which contains a double integral, using
"nlminb" for the minimization and "adapt" for the integral. The integral is
over two variables (thita and radiusb)
and the 3 free parameters I want to derive from the minimization are
counts0, index and radius_eff.
I have used both tasks in the past successfully but this is the first time
2007 Jul 07
2
No convergence using ADAPT
I am trying calculate a probability using numerical integration. The first
program I ran spit out an answer in a very short time. The program is below:
## START PROGRAM
trial <- function(input)
{
pmvnorm(lower = c(0,0), upper = c(2, 2), mean = input, sigma = matrix(c(.1, 0,
0, .1), nrow = 2, ncol = 2, byrow = FALSE))
}
require(mvtnorm)
require(adapt)
bottomB <- -5*sqrt(.1)
topB <-
2008 Oct 19
1
multivariate integral with ADAPT when the parameter is close to boundary
Dear All,
There is one problem I encountered when I used ADAPT to compute some
2-D integral w.r.t beta density.
For example, when I try to run the following comments:
fun2<-function(theta){return(dbeta(theta[1],0.005,0.005)*dbeta(theta[2],0.005,0.005))}
int.fun2<-adapt(ndim=2,lo = c(0,0), up = c(1,1),functn = fun2,eps = 1e-4)
It seems it will take very long time to run. Acturally, I
2006 Nov 17
0
Question regarding "integrate" function
Hi there. Thanks for your time in advance.
My final goal is to calculate 1/2*integral of
(f1(x)^1/2-f2(x)^(1/2))^2dx (Latex codes:
$\frac{1}{2}\int^{{\infty}}_{\infty} (\sqrt{f_1(x)}-\sqrt{f_2(x)})^2dx
$.) where f1(x) and f2(x) are two estimated marginal densities.
My problem:
I have the following R codes using "adapt" package. Although "adapt"
function is mainly designed
2006 Nov 17
0
questions regarding "integrate" function in R
Hi there. Thanks for your time in advance.
My final goal is to calculate 1/2*integral of
(f1(x)^1/2-f2(x)^(1/2))^2dx (Latex codes:
$\frac{1}{2}\int^{{\infty}}_{\infty}
(\sqrt{f_1(x)}-\sqrt{f_2(x)})^2dx $.) where f1(x) and f2(x) are two
marginal densities.
My problem:
I have the following R codes using "adapt" package. Although "adapt"
function is mainly designed for more
2005 Nov 23
4
x[1,], x[1,,], x[1,,,], ...
Hi,
is there a function in R already doing what I try to do below:
# Let 'x' be an array with *any* number of dimensions (>=1).
x <- array(1:24, dim=c(2,2,3,2))
...
x <- array(1:24, dim=c(4,3,2))
i <- 2:3
ndim <- length(dim(x))
if (ndim == 1)
y <- x[i]
else if (ndim == 2)
y <- x[i,]
else if (ndim == 3)
y <- x[i,,]
else ...
and so on. My current
2008 Mar 07
1
triple integral: adapt package question
Dear All,
I have a function f(x,y,z)=exp(x^3+y^4+x^2*y+x*z^2+y/z) over D, where is D={
(x,y,z)| 0 <z<Inf, 0<y<c1*z, 0<x<c2*/y}. x,y,z are all vectors and c1 and c2
are constants. I tried the "adapt" package and I get some error. This is the
error message:
"Error in function (z, y, x) : argument "x" is missing, with no default"
I included my R
2013 Oct 18
1
crr question in library(cmprsk)
Hi all
I do not understand why I am getting the following error message. Can
anybody help me with this? Thanks in advance.
install.packages("cmprsk")
library(cmprsk)
result1 <-crr(ftime, fstatus, cov1, failcode=1, cencode=0 )
one.pout1 = predict(result1,cov1,X=cbind(1,one.z1,one.z2))
predict.crr(result1,cov1,X=cbind(1,one.z1,one.z2))
Error: could not find function
2004 Oct 21
5
Cluster Analysis: Density-Based Method
Hi people,
Does anybody know some Density-Based Method for clustering implemented in R?
Thanks,
Fernando Prass
_______________________________________________________