Questions tagged [numerical-integration]

A class of algorithms to approximate definite integrals.

Wikipedia has an article https://en.wikipedia.org/wiki/Numerical_integration with further references.

147 questions
42
votes
8 answers

Approximate $e$ using Monte Carlo Simulation

I've been looking at Monte Carlo simulation recently, and have been using it to approximate constants such as $\pi$ (circle inside a rectangle, proportionate area). However, I'm unable to think of a corresponding method of approximating the value of…
16
votes
1 answer

Metropolis-Hastings integration - why isn't my strategy working?

Assume I have a function $g(x)$ that I want to integrate $$ \int_{-\infty}^\infty g(x) dx.$$ Of course assuming $g(x)$ goes to zero at the endpoints, no blowups, nice function. One way that I've been fiddling with is to use the Metropolis-Hastings…
13
votes
2 answers

Integrating kernel density estimator in 2D

I'm coming from this question in case anybody wants to follow the trail. Basically I have a data set $\Omega$ composed of $N$ objects where each object has a given number of measured values attached to it (two in this case): $$\Omega = o_1[x_1,…
13
votes
2 answers

Why is pseudo-random sampling applicable for Monte Carlo integration, even though it does not satisfy the CLT requirements?

Assume we have a function $f\left(x\right)$ defined on $\left[0, 1\right]$ that we want to integrate and estimate the error using Monte Carlo method. We generate realizations of uniformly distributed independent random variables $x_n$ on $\left[0,…
13
votes
3 answers

what does one mean by numerical integration is too expensive?

I am reading about Bayesian inference and I came across the phrase "numerical integration of the marginal likelihood is too expensive" I do not have a background in mathematics and I was wondering what exactly does expensive mean here? Is it just…
11
votes
5 answers

Estimate the Euler–Mascheroni constant ($\gamma$) by Monte Carlo simulations

The Euler–Mascheroni constant is defined simply as the limiting difference between harmonic series and the natural logarithm. $$\gamma =\lim_{n\to \infty}\left(\sum _{k=1}^{n}{\frac {1}{k}}-\ln n\right)$$ I was interested in the estimations of…
10
votes
1 answer

Integrate with eCDF quickly in R

I have an integral equation of the form $$ T_1(x) = \int_0^x g(T_1(y)) \ d\hat{F}_n(y) $$ where $\hat{F}_n$ is the empirical cdf and $g$ is a function. I have a contraction mapping and so I am trying to solve the integral equation by using the…
Newbie
  • 101
  • 3
10
votes
1 answer

Monte Carlo Integration for non-square integrable functions

I hope this is the right place to ask, if not feel free to move it to a more appropriate forum. I've been wondering for quite a while now how to treat non-square integrable functions with Monte Carlo Integration. I know that MC still gives a proper…
cschwan
  • 203
  • 1
  • 5
10
votes
1 answer

Plain English explanation of Ito's integral?

I'm looking for a plain English explanation of Ito's integral. I don't need an exhaustive proof, derivation, etc. Just a simple ~this is effectively what it does and why it's better than a Riemann sum (or insert other numeric approximation.) With…
10
votes
1 answer

Likelihood and estimates for mixed effects Logistic regression

First let's simulate some data for a logistic regression with fixed and random parts: set.seed(1) n <- 100 x <- runif(n) z <- sample(c(0,1), n, replace=TRUE) b <- rnorm(2) beta <- c(0.4, 0.8) X <- model.matrix(~x) Z <- cbind(z,…
7
votes
1 answer

Expressing a marginal probability using copulas

Please correct me if I am wrong and kindly provide me with the correct notations. I have two questions: We know that for the variables $(X,Y,Z)\in \mathbb{R}^3$, the marginal joint density $f(x,y)$ can be expressed…
7
votes
2 answers

What is better in Monte Carlo integration: product of means or mean of products?

Let $X$ and $Y$ be two independent continuous random variables with pdfs $f_X$ and $f_Y$, respectively. Let $\varphi_1$ and $\varphi_2$ be two continuous functions from ${\mathbb R}$ to ${\mathbb R}$. I want to calculate…
7
votes
4 answers

Expectation of $\ln(1 + e^x)$, where $x$ is normally distributed

I need to evaluate the following integral: $$\int_{-\infty}^\infty\mathrm d x \exp\left(-\frac{(x-\mu)^2}{2\nu}\right) \ln(1+e^x)$$ where $\mu$ is a finite real number and $\nu > 0$. This is just the average value of $\ln(1+e^x)$, when $x$ is…
becko
  • 3,298
  • 1
  • 19
  • 36
7
votes
1 answer

Use Importance Sampling and Monte carlo for estimating a summation

Maybe my question is pretty basic and dumb. I'm studying computer science. In one problem i have to use Monte Carlo method and Importance sampling in order to estimate a big sum. I've seen Monte Carlo integration that may be the same but i am…
7
votes
1 answer

Calculating the integral of a PDF inside a closed contour of constant density

I'm working with some two-dimensional probability distributions which have emerged from Bayesian inference work I'm doing. These PDFs are stored on regularly spaced Cartesian grids. I feel like it would be quite common for one to wish to find a…
1
2 3
9 10