similar to: Multidimensional quadrature using "integrate"

Displaying 20 results from an estimated 10000 matches similar to: "Multidimensional quadrature using "integrate""

2008 Mar 12
3
Types of quadrature
Dear R-users I would like to integrate something like \int_k^\infty (1 - F(x)) dx, where F(.) is a cumulative distribution function. As mentioned in the "integrate" help-page: integrate(dnorm,0,20000) ## fails on many systems. This does not happen for an adaptive Simpson or Lobatto quadrature (cf. Matlab). Even though I am hardly familiar with numerical integration the implementation
2011 Nov 06
2
how to use quadrature to integrate some complicated functions
Hello to all, I am having trouble with intregrating a complicated uni-dimensional function of the following form Phi(x-a_1)*Phi(x-a_2)*...*Phi(x-a_{n-1})*phi(x-a_n). Here n is about 5000, Phi is the cumulative distribution function of standard normal, phi is the density function of standard normal, and x ranges over (-infty,infty). My idea is to to use quadrature to handle this integral. But
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
2006 May 05
0
Spline integration & Gaussian quadrature (was: gauss.quad.prob)
Spencer Thanks for your thoughts on this. I did a bit of work and did end up with a method (more a trick), but it did work. I am certain there are better ways to do this, but here is how I resolved the issue. The integral I need to evaluate is \begin{equation} \frac{\int_c^{\infty} p(x|\theta)f(\theta)d\theta} {\int_{-\infty}^{\infty} p(x|\theta)f(\theta)d\theta} \end{equation} Where
2010 Apr 14
2
Gaussian Quadrature Numerical Integration In R
Hi All, I am trying to use A Gaussian quadrature over the interval (-infty,infty) with weighting function W(x)=exp(-(x-mu)^2/sigma) to estimate an integral. Is there a way to do it in R? Is there a function already implemented which uses such weighting function. I have been searching in the statmode package and I found the function "gauss.quad(100, kind="hermite")" which uses
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
2006 Jul 17
1
multiplying multidimensional arrays (was: Re: [R] Manipulation involving arrays)
I am moving this to r-devel. The problem and solution below posted on r-help could have been a bit slicker if %*% worked with multidimensional arrays multiplying them so that if the first arg is a multidimensional array it is mulitplied along the last dimension (and first dimension for the second arg). Then one could have written: Tbar <- tarray %*% t(wt) / rep(wti, each = 9) which is a bit
2008 Sep 27
3
Double integration - Gauss Quadrature
Hi, I would like to solve a double integral of the form \int_0^1 \int_0^1 x*y dx dy using Gauss Quadrature. I know that I can use R's integrate function to calculate it: integrate(function(y) { sapply(y, function(y) { integrate(function(x) x*y, 0, 1)$value }) }, 0, 1) but I would like to use Gauss Quadrature to do it. I have written the following code (using R's statmod package)
2008 Mar 13
3
Use of ellipses ... in argument list of optim(), integrate(), etc.
Hi, I have noticed that there is a change in the use of ellipses or . in R versions 2.6.1 and later. In versions 2.5.1 and earlier, the . were always at the end of the argument list, but in 2.6.1 they are placed after the main arguments and before method control arguments. This results in the user having to specify the exact (complete) names of the control arguments, i.e. partial matching is
2011 Apr 28
0
fit a marked poisson process using a quadrature scheme with 'spatstat'
Hello everyone, My data consists of marked points and several covariates, whereby the marks are the time points of the observations. The problem is, that one of the covariates is hard to handle as an image. This covariate represents the type of roads. As there aren't roads at every location of the map, one cannot specify the value of the covariate at any point on a grid, which is necessary to
2003 Jun 23
0
A final global mode function
>From spencer.graves at PDF.COM Mon Jun 23 14:36:45 2003 Received: from postal.pdf.com (pdf193.pdf.com [209.128.81.193]) by uhddx01.dt.uh.edu (8.9.2/8.9.2) with ESMTP id OAA09671 for <hodgess at uhddx01.dt.uh.edu>; Mon, 23 Jun 2003 14:36:44 -0500 (CDT) Received: from postage.pdf.com (postage.pdf.com [10.10.8.7]) by postal.pdf.com (Switch-3.0.4/Switch-3.0.0) with ESMTP id
2004 Jul 03
4
counting the occurrences of vectors
Hi: I have two matrices, A and B, where A is n x k, and B is m x k, where n >> m >> k. Is there a computationally fast way to count the number of times each row (a k-vector) of B occurs in A? Thanks for any suggestions. Best, Ravi. [[alternative HTML version deleted]]
2007 Mar 21
2
Gaussian Adaptive Quadrature
Hi all, Does anybody know any function that performs gaussian adapative quadrature integration of univariate functions? Thanks in advance, Regards, Caio __________________________________________________ [[alternative HTML version deleted]]
2002 Nov 25
3
How top print intermediate values from inside a function?
Hi: In R, how do I display some intermediate results calculated in a "for" loop within a function? For example, in the attached code, how do I get it to print the intermediate variable "mh.new" for each simulation, when I call the function "MHsim.ind"? thanks for any help, Ravi. #################################################################### MHsim.ind
2009 May 08
1
ADAPTIVE QUADRATURE WEIGHTS AND NODES
Can anyone help me on how to get the nodes and weights of the adaptive quadrature using R. Best wishes Boikanyo. ----- The University of Glasgow, charity number SC004401
2003 Jul 09
2
A problem with using the "outer" function
Hi: I am using R 1.7.0 on Windows. I am having trouble getting "outer" to work on one of my functions. Here is a simple example illustrating my problem: > b1 <- c(1.2,2.3) > b2 <- c(0.5,0.6) > x <- c(3e+01, 1e+02, 3e+02, 5e+02, 1e+03, 1e+04, 1e+05, 1e+06) > y <- c(2,4,2,5,2,3,1,1) > n <- c(5,8,3,6,2,3,1,1) > outer(b1,b2,FUN=bpllkd,x,y,n)
2007 Mar 09
1
MCMC logit
Hi, I have a dataset with the binary outcome Y(0,1) and 4 covariates (X1,X@,X#,X$). I am trying to use MCMClogit to model logistic regression using MCMC. I am getting an error where it doesnt identify the covariates ,although its reading in correctly. The dataset is a sample of actual dataset. Below is my code: > ####################### > > > #retreive data > # considering four
2007 Dec 17
3
integration
Dear All, I need to perform a numerical integration of one dimensional fucntions. The extrems of integration are both finite and the functions I'm working on are quite complicated. I have already tried both area() and integrate(), but they do not perform well: area() is very slow and integrate() does not converge. Are in R other functions for numerical integration of one dimentional
2006 Aug 21
1
New version of glmmML
A new version, 0.65-1, of glmmML is now on CRAN. It is a major rewrite of the inner structures, so frequent updates (bug fixes) may be expected for some time. News: * The Laplace and adaptive Gauss-Hermite approximations to the log likelihood function are fully implemented. The Laplace method is made the default. It should give results you can compare to the results from 'lmer' (for the
2006 Aug 21
1
New version of glmmML
A new version, 0.65-1, of glmmML is now on CRAN. It is a major rewrite of the inner structures, so frequent updates (bug fixes) may be expected for some time. News: * The Laplace and adaptive Gauss-Hermite approximations to the log likelihood function are fully implemented. The Laplace method is made the default. It should give results you can compare to the results from 'lmer' (for the