Displaying 20 results from an estimated 600 matches similar to: "triple integral: adapt package question"
2008 Mar 04
1
simulation study using R
Dear All,
I am running a Monte Carlo simulation study and have some questions on how
to manage data storage efficiently at the end of each 1000 replication loop.
I have three conditions coded using the FOR {} loops and a FOR loop that
generates data for each condition, performs analysis, and computes a
statistic 1000 times. Therefore, for each condition, I will have 1000
statistic values. My
2008 Mar 05
1
degrees of freedom extraction
Hello,
II used the logLik() function to get the log-likelihood estimate of an
object. The function also prints the degrees of freedom. How can I extract
the degrees of freedom and assign it to a variable.
Below is the output:
> logLik(fit2pl)
'log Lik.' -4842.912 (df=36)
Thanks,
Davood Tofighi
[[alternative HTML version deleted]]
2008 Mar 10
1
ltm package question
Hello All,
I was wondering how I can get the overall Pearson chi^2 test of model fit
with its df and p value in the LTM package for the 2PL models.
Thanks,
--
Davood Tofighi
Department of Psychology
Arizona State University
[[alternative HTML version deleted]]
2008 Mar 15
1
filehash
Hello,
I'm using filehash on the windows XP and it has been working fine with the
newest R version 2.6.2. However, on the windows vista, when I ran the same
code, I got the following error:
> dbCreate("simdb") #create simdb database
[1] TRUE
> db<-dbInit("simdb") #initiate an object of database
Error in sprintf(gettext(fmt, domain = domain), ...) :
object
2008 Mar 04
0
simulation study using R [SEC=UNCLASSIFIED]
Davood,
I developed an MC simulation model for wind
hazard analysis last year. I found three important
issues to increase efficiency:
1) Reuse most variables in each loop
2) Write results (1000 stats) to external files, perhaps
one file for each condition.
(a good ID for each file can be implemented using "paste")
3) Develop a function to process the results stored in
the external
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
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 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 <-
2017 Jun 21
0
Problem with shortestPath in igraph and qgraph
Hard to follow data analysis without data. Try making your example reproducible [1][2][3] and post in plain text (a setting in your emailer). Read the Posting Guide mentioned in the footer to avoid other posting pitfalls.
[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
[2] http://adv-r.had.co.nz/Reproducibility.html
[3]
2007 Oct 29
1
meaning of lenwrk value in adapt function
R-listers,
In using the adapt function, I am getting the following warning:
Ifail=2, lenwrk was too small. -- fix adapt() !
Check the returned relerr! in: adapt(ndim = 2, lower = lower.limit,
upper = upper.limit, functn = pr.set,
Would someone explain what the 'lenwrk' value indicates in order to help
diagnose this issue.
Also, what are the possible codes for Ifail, so I can set
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
2006 Nov 11
2
Bayesian question (problem using adapt)
In the following code I have created the posterior density for a Bayesian
survival model with four parameters. However, when I try to use the adapt
function to perform integration in four dimensions (on my old version of R
I get an error message saying that I have applied a non-function, although
the function does work when I type kernel2(param0, theta0), or on the
newer version of R the computer
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
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.
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,
2003 Apr 26
2
Multiple Integration
Dear all,
May I do multiple integration using R? I was looking
adapt but it is saying it integrates a scalar function
over a multidimensional rectangle. I have integrand of
several variable and upper, lower limit too variable.
I wanted to see the result using adapt (though it is
not for this purpose, I suppose)
Func<-function(x){(x[1]*x[2])}
adapt(2, lo=c(0,1), up=c(1,x[1]), functn=Func)
it
2017 Jun 20
2
Problem with shortestPath in igraph and qgraph
hello,
I have a graph and i use qgraph package to calculate centrality parameters.
Now I want to know the maximum value of shortest path for each vertex with
discarding the Inf value in short pathes. For this I use the
ShortestPathLengths of centrality function in qgraph. but when I want to
get the maximum the result is wrong. here is my code:
cen<-centrality(Q)
2005 Mar 10
3
two-dimensional integration?
I find the one-dimensional "integrate" very helpful,
but often enough I stumble into problems that require
two (or more)-dimensional integrals. I suppose there
are no R functions that can do this for me, "directly"?
The ideal thing would be to be able to define say
f <- function(x)
{
x1 <- x[1]
x2 <- x[2]
sin(x1*x2)*exp(x1-x2)
}
and then write say
integrate(f,
2017 Jun 18
1
error for using igraph library: 'edges' must be numeric or character
hello, i want to use igraph for drawing graph of my data. First time i try
do it and it was successful. but now i want to test again i got this error:
"edges must be numeric or character". this is my edge list(this is output
from R):
From To
1 US20100331312
2 US20100331341
3 US20100330919 US20100041339
4 US20100330919 US20100195590
5 US20100330919
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"