Displaying 20 results from an estimated 2000 matches similar to: "functions for high dimensional integral"
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,
2006 Apr 28
1
gauss.quad.prob
I've written a series of functions that evaluates an integral from -inf to a or b to +inf using equally spaced quadrature points along a normal distribution from -10 to +10 moving in increments of .01. These functions are working and give very good approximations, but I think they are computationally wasteful as I am evaluating the function at *many* points.
Instead, I would prefer to use
2001 Nov 09
3
A chinese R-info page and a question
Dear R community,
I wrote and someone else helped me type a 5-page R-info in Chinese,
covering the most basic information on how to get and install
and start using R on Wintel PC.
This could serve those not fluent in/intimidated by
English but want to start using R.
(I met a lot of those in China)
<http://www.ms.uky.edu/~mai/ZhongWen.htm>
also a MSword version of the same (may print
2008 Aug 21
2
Help Regarding 'integrate'
I have an R function defined as:
f<-function(x){
return(dchisq(x,9,77)*((13.5/x)^5)*exp(-13.5/x))
}
Numerically integrating this function, I observed a couple of things:
A) Integrating the function f over the entire positive real line gives an
error:
> integrate(f,0,Inf)
Error in integrate(f, 0, Inf) : the integral is probably divergent
B) Increasing the interval of integration
2006 Aug 22
1
a generic Adaptive Gauss Quadrature function in R?
Hi there,
I am using SAS Proc NLMIXED to maximize a likelihood with
multivariate normal random effects. An example is the two part random
effects model for repeated measures semi-continous data with a
cluster at 0. I use the "model y ~ general(loglike)" statement in
Proc NLMIXED, so I can specify a general log likelihood function
constructed by SAS programming statements. Then the
2007 Oct 23
2
2-D numerical integration over odd region
Hello all,
I'm hoping to find a way to evaluate the following sort of integral in R.
\int_a^b \int_{g(y)}^Inf f(x,y) dx dy.
The integral has no closed form and so must be evaluated numerically. The "adapt" package provides
for multidimensional integration but does not appear to allow the limits of integration to be a
function. I need to evaluate a number of integrals of this
2005 Dec 15
1
generalized linear mixed model by ML
Dear All,
I wonder if there is a way to fit a generalized linear mixed models (for repeated binomial data) via a direct Maximum Likelihood Approach. The "glmm" in the "repeated" package (Lindsey), the "glmmPQL" in the "MASS" package (Ripley) and "glmmGIBBS" (Myle and Calyton) are not using the full maximum likelihood as I understand. The
2005 Nov 03
1
multidimensional integration not over a multidimensionalrectangle
Hi,
anyone knows about any functions in R can get multidimensional integration
not over a multidimensional rectangle (not adapt).
For example, I tried the following function f(x,n)=x^n/n!
phi.fun<-function(x,n)
{ if (n==1) {
x
}else{
integrate(phi.fun, lower=0, upper=x, n=n-1)$value
}
}
I could get f(4,2)=4^2/2!=8, but failed in f(4,3)=4^3/3! Thanks
Best,
Lynette
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)
2007 May 24
3
Problem with numerical integration and optimization with BFGS
Hi R users,
I have a couple of questions about some problems that I am facing with
regard to numerical integration and optimization of likelihood
functions. Let me provide a little background information: I am trying
to do maximum likelihood estimation of an econometric model that I have
developed recently. I estimate the parameters of the model using the
monthly US unemployment rate series
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
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 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
2002 Apr 20
2
integration of a discrete function
Dear R list
I am looking for a function in R that computes the integration of a
discrete curve, such as a power spectrum, in a specified interval (in my
case, that would be 'power in a certain frequency band'). I found only
functions, such as 'integrate', that perform adaptive quadrature on
analytic functions, and not on a curve specified as a set of (x,y) pairs.
I have the
2011 Dec 10
2
efficiently finding the integrals of a sequence of functions
Hi folks,
I am having a question about efficiently finding the integrals of a list of
functions. To be specific,
here is a simple example showing my question.
Suppose we have a function f defined by
f<-function(x,y,z) c(x,y^2,z^3)
Thus, f is actually corresponding to three uni-dimensional functions
f_1(x)=x, f_2(y)=y^2 and f_3(z)=z^3.
What I am looking for are the integrals of these three
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
2003 Feb 11
0
Parallel Processing Interface for lapply()
In co-operation with Markus Hegland and myself, Zhongwen Ding
has written a package, based partly on Markus Hegland's code,
that provides a parallel processing interface to a remote
multi-processsor system. Pyro (Python Remote Objects) and R
must both be installed, both on the client machine and on the remote
server. The system uses rsync, with an ssh protocol, to handle
file transfer.
Once
2018 Jan 17
1
mgcv::gam is it possible to have a 'simple' product of 1-d smooths?
I am trying to test out several mgcv::gam models in a scalar-on-function regression analysis.
The following is the 'hierarchy' of models I would like to test:
(1) Y_i = a + integral[ X_i(t)*Beta(t) dt ]
(2) Y_i = a + integral[ F{X_i(t)}*Beta(t) dt ]
(3) Y_i = a + integral[ F{X_i(t),t} dt ]
equivalents for discrete data might be:
1) Y_i = a + sum_t[ L_t * X_it * Beta_t ]
(2) Y_i
2007 Apr 09
1
How to solve differential and integral equation using R?
Hello,
I want to know if there are some functions or packages to solve differential
and integral equation using R.
Thanks.
Shao chunxuan.
[[alternative HTML version deleted]]
2013 Oct 11
3
Gaussian Quadrature for arbitrary PDF
Hi all,
We know that Hermite polynomial is for
Gaussian, Laguerre polynomial for Exponential
distribution, Legendre polynomial for uniform
distribution, Jacobi polynomial for Beta distribution. Does anyone know
which kind of polynomial deals with the log-normal, Studentæ¯ t, Inverse
gamma and Fisheræ¯ F distribution?
Thank you in advance!
David
[[alternative HTML version deleted]]