Questions tagged [numerical-integration]

A class of algorithms to approximate definite integrals.

Filter by
Sorted by
Tagged with
3
votes
0answers
26 views

Integration by sampling from truncated distribution

I'm reading the book Ben Lambert's Bayesian Statistics: problems and answers, which by the way I like. There is a group of problems in "Integration by Sampling" chapter 12. The first integral is $$...
1
vote
1answer
36 views

How to calculate mean and variance from very small function proportional to the density?

Problem Say I have the following function $g(x)$, which is proportional to the density function $f_\theta(\theta)$ of random variable $\theta$, i.e. $g(\theta) \propto f(\theta)$, such that $$ \...
1
vote
0answers
19 views

Error bars of Monte Carlo expectation with correlated samples

I will try to phrase the question in a general way, then give my specific case as an example. Suppose I want to evaluate $Q = \mathbb E \left[ f\left(X, Y \right) \right]$ where $X$ and $Y$ are ...
1
vote
1answer
52 views

Estimating the population median from a kernel density estimator

I have a 1-d kernel density estimate in the form of two vectors: x_grid is a vector of x-values at which the density function was sampled ...
1
vote
0answers
27 views

Monte Carlo integration for Bayesian parameter estimation

I want to determine the credible interval of a quantity $\theta_1$. I want to make this estimate using observed data by assuming a certain model which depends on $\theta_1$ as well as about n=15 ...
0
votes
0answers
9 views

What kind of algorithms are appropriate for this sort of medium-dimensional integration problem?

I'm trying to model a situation in which an agent must select one of several choices (not more than ten). Each choice is associated with a vector, known to the agent, representing its effectiveness in ...
6
votes
2answers
182 views

Numerically/approximately integrating over independent gamma variables

Problem Statement For a problem in biology, I am testing out a joint distribution of the form: $$ X \sim Multinomial(\frac{\theta_1}{\sum \theta_i}, ...,\frac{\theta_n}{\sum{\theta_i}}) \\ \theta_i \...
1
vote
0answers
38 views

How to perform MCMC integration when no prior over the integrated function is available? [closed]

As far as I can tell, MCMC integration (e.g. VEGAS) is performed by sampling from a distribution proportional to $f(x)$ using MCMC, then building a density estimator $g(x)$ using these samples (for ...
2
votes
1answer
44 views

Evaluating problematic function when cdf is close to one?

Let $F(x;\theta)$ be a cumulative distribution function and $\beta>0$. I need to evaluate $$\rho=\frac{F(x;\theta)^\beta}{F(x;\theta)-F(x;\theta)^{\beta+1}},$$ but, for some values of $\theta$, R ...
2
votes
1answer
42 views

Calculating Integral Using MCMC

Consider the integral $\int_{\Theta}f(\theta|\mathbf{x}) \Pi(\theta)d\theta$,where $\theta$ is a univariate parameter and $\Theta$ is the support of $\Pi(\theta)$. I need to evaluate the value of this ...
0
votes
0answers
18 views

Is there a function to calculate the critical Tietjen-Moore value?

The NIST article on the Tietjen-Moore Test for outliers recommends calculating the critical value by simulation, generating 10,000 sets of data. Is there a function that can be numerically integrated ...
2
votes
1answer
67 views

Issues with qbeta and pbeta [closed]

I'm trying to get samples from truncated beta. I have written the following function based on inverse transform sampling method to do so, however, it seems that when CDF converges to 1 fast, pbeta ...
4
votes
2answers
95 views

MCMC combined with numerical integration towards more efficient Bayesian inference

I am quite new to Bayesian statistics so the question can be a bit naive. My question is on how to deal with a model with individual coefficients. Simple versions of a task and a model I deal with is ...
2
votes
0answers
109 views

Calculating expected loss of posterior distribution

I'm working with 2 posterior distributions from AB tests. For the sake of simplicity let's assume: $$ A\sim Beta(10, 20) $$ $$ B\sim Beta(5, 25) $$ I want to calculate the posterior expected loss of ...
0
votes
1answer
413 views

What is the difference between monte carlo integration and gibbs sampling?

I am aware that both are methods of sampling from the posterior. MC integration replaces the integral by a sample MC sample. Is this sample independent? Gibbs sampling is a class of MCMC ...
0
votes
1answer
70 views

Approximate a CDF

Suppose we have $n$ equations with an integral of the form $\int_0^{x_i} F(z)dz = c_i,\ i=1,\ldots,n$ where $F(y)=\mathbb{P}(X \le y)$ is an unknown cumulative distribution function of a non-negative ...
5
votes
1answer
233 views

Constant of Laplace approximation

I'm reading Example 3.16 of Robert & Casella's Monte Carlo Statistical Methods. It uses a Laplace approximation for approximating an integral related with the Gamma distribution namely $$\int_a^b\...
6
votes
1answer
633 views

How to choose best proposal distribution for importance sampling

From Robert & Casella p95, we know that the choice of proposal distribution $g(x)$ with minimal variance is the $g$ proportional to $|h(x)|f(x)$. If we restrict our proposal distribution to cetain ...
1
vote
2answers
158 views

Expected value of $X$ which follows a normal distribution, between a certain interval [duplicate]

What is the process of finding the expected value of $X$ in a normal distribution between a certain interval? In particular I want to find: $E(X | a \le X \le b)$. For example, if $X$ has $\mu=0$ ...
3
votes
1answer
257 views

Calculating integral by using Monte Carlo method

I am asked to calculate the value of the following integral by using Monte Carlo method. $$I=\int_{\mathbb{R^{10}}}(2\pi)^{-10/2}\exp\left(-\sum_{i=1}^{10}\frac{x_i^2}{2}+\sin\left(\sum_{i=1}^{10}x_i\...
3
votes
0answers
320 views

Estimating standard error of Monte Carlo integration, non-MCMC version

Let us suppose that we're to evaluate the expectation of a random variable $h$ with respect to some distribution $\pi$, $\text{E}_{\pi}[h]$. The standard Monte Carlo estimate, using a sample of $X_1, ...
1
vote
1answer
36 views

Efficient estimation of conditional means from pdf, CDF, & quantile function supplied numerically

Suppose I have a a probability distribution that I know to have a continuous differentiable unimodal pdf, with pdf(x) strictly greater than zero for all x in the positive half-plane. In addition, I ...
0
votes
1answer
1k views

How to calculate joint distribution by integrating over all possible values of model parameters and observations

I was wondering how to calculate the following joint distribution by assuming that $x_i$'s are continuous observations from normal distirbution $N(\mu, \sigma)$ with mean $\mu$ and variance $\sigma$ ...
3
votes
0answers
138 views

Low-valued multivariate integral in R [closed]

I'm trying to calculate multivariate normal integrals in R, with relatively high dimensions. I've tried the openMX and cubature packages. The problem is that the integrals become too small and I get ...
0
votes
1answer
216 views

Metropolis-Hastings Algorithm for Numerical Integration [duplicate]

I'm attempting to implement a Metropolis-Hastings Algorithm to evaluate integrals of the following form: $$I =\frac{1}{\sqrt\pi}\int_{-\infty}^{\infty} {f(x)\exp(-x^2)} \text{d}x$$ Now we can ...
1
vote
1answer
229 views

What does it mean that high dimensional integration is difficult?

When we say numerical integration is difficult for high dimensional problems, what do we mean by high dimensional? For example, in the Bayesian framework, the marginal normalizing constant can be ...
2
votes
2answers
143 views

Savitzky-Golay … integrator?

Background: Savitzky-Golay filters (yes they have other names) are robust estimators of slope. Where a small noise can substantially damage the slope estimate of textbook finite difference methods, ...
0
votes
1answer
203 views

Rollmean vs. Integrate.xy for computing Integrals

I have a density function in R that reflects an underlying null distribution, for example: density_null=density(rnorm(100)) I want to integrate between 0 and ...
1
vote
0answers
172 views

Advantages of monte carlo over numerical quadrature for integration in low dimension MLE?

I am doing a parameter estimation for a two-level model via maximum likelihood estimation. My MLE optimization procedure requires multiple numerical integrations over a 3 dimensional space at each ...
1
vote
0answers
51 views

Proving an equivalence relation by using numerical methods such as Gaussian quadrature

The background is residual useful life prediction. The following is my problem description. Degradation signal path: $r(t)=\phi+\theta t$ , where $\phi$ is assumed to be the same for all units,and $\...
2
votes
0answers
48 views

Numerical methods for one-dimensional Bayesian inference

I am doing inference using a Bayesian model that has only one variable, which boils down to computing a (one-dimensional) cumulative distribution and a quantile function given the log of a probability ...
2
votes
0answers
128 views

Maximum likelihood estimation using a random number generator

Imagine that I have a random number generator $X$ where it is impossible (or mathematicaly intractable) to calculate its probability density function - this can happen when we compose several simpler ...
0
votes
1answer
429 views

Having integration in Bayesian model: what package to use?

I have a bit experience on Bayesian analysis and am a JAGS user. Recently I have to run a more complicated model that contains integration (I use adaptIntegrate from cubature package in the original ...
1
vote
1answer
76 views

I have three probabilities of a value falling within the following ranges +/- 5%, +/- 10% and +/- 20% of the mean value

I have the mean value and my question is: is it possible to calculate the standard deviation assuming a normal distribution? Looking at previous questions which have been asked, this question is ...
2
votes
1answer
99 views

The median of the absolute value of the difference of two dependent log normal random variables

Assume X and Y have a bivariate lognormal distribution (x,y>0) that is: $f_{X,Y}(x,y)$=$$\frac{1}{2p\sqrt{1-r^2}xy\sigma_1\sigma_2}exp\{\frac{-1}{2(1-r^2)}[(\frac{ln(x)-\mu_1}{\sigma_1})^2-2r(\frac{...
1
vote
1answer
139 views

Linear regression of B-splines with terms inside an integral?

I have encountered a problem that the literature suggests linear regression is able to solve, but I am at a loss. I have a function $F$ that I want to estimate. This function obeys $N$ equations of ...
5
votes
1answer
550 views

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 ...
1
vote
0answers
53 views

How to run a least squares fitting over implicit variables INSIDE a double integration?

I am trying to create an algorithm to fit dI/dV data from a superconducting sample, and eventually a GUI. There is a double integration involved over the product of two functions Fermi function and ...
2
votes
0answers
39 views

Highly dimensional Monte Carlo integration over state space

I am trying to estimate the following expectation value $$\mu_f = \sum_x f(x) \Pr(x)$$ for a function $f(x)$ defined for every point $x=(x_1,...,x_p)$ in ordinal state space $\Omega$ (i.e. a discrete ...
12
votes
3answers
2k views

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 ...
1
vote
0answers
31 views

Law of total probability relationship to an empirical mean

I'm really just trying to learn the name of this particular rule so that I can learn more about it. Say we wish to characterize the distribution of some random variable $Y$, and we have a sample of $...
4
votes
0answers
633 views

Faster computation of high-dimensional multivariate normal probabilities

My goal is to find a faster way to calculate something like mvtnorm::pmvnorm(upper = rep(1,100)) that is, the tail probability of multivariate normal distribution ...
3
votes
1answer
117 views

Monte Carlo Integration on the Real Line

Suppose that we want to compute $$\int_{\mathbb{R}} f(x) dx$$ using monte carlo integration so that we can normalize $f(x)$ and make it a pdf. The examples you typically see involve integrals over a ...
2
votes
1answer
385 views

Approximation expectation integral

Suppose that I have a function $g(x): R \rightarrow R$ and suppose that the pdf of $x$ is $f(x)$. To avoid cumbersome numerical integration I approximate the expected value of $g(x)$ as $\int_{x = -\...
0
votes
1answer
159 views

Monte Carlo evaluation of Integrated Square Error for Kernel Density Estimation

Given the true density function $p(\mathbf{x})$ and the estimated density $q(\mathbf{x})$, I want to evaluate how close these two density are by Integrated Squared Error (ISE) criterion, $\int{(p(\...
1
vote
0answers
253 views

Applying a weighting function to a curve over a definite integral

I am trying to replicate a sensor's output by modeling the spectral signal it receives and weighting that curve by the sensor's non-uniform spectral response curve. Here are what the two spectral ...
1
vote
1answer
201 views

What is the difference between MCMC and Gauss-Legendre quadrature for integration? Can one substitute the other?

Both MCMC and Legendre quadrature are numerical methods for integration. Method 1: MCMC $$E[g(X)] = \int f(x) g(x) \, dx$$ Method 2: Gauss-Legendre quadrature $$\int_{0.5}^{1.5} e^x \cos x \,...
2
votes
1answer
200 views

How to integrate lognormal equation?

The problem comes from the personal research $h \sim \log N(\mu,\sigma^2)$ then $$f_H(h) = \frac{1}{h\sigma\sqrt{2\pi}}\exp\left[-\frac{1}{2}\left(\frac{\log h-\mu}{\sigma}\right)^2\right].$$ Here ...
0
votes
1answer
258 views

Propagate errors in measured points to Simpson's numerical integral

I have a set of measured/observed $y(x)$ points, each with an assigned standard deviation: $$y: \{y_0\pm\sigma_{y_0}, y_2\pm\sigma_{y_2}, ..., y_N\pm\sigma_{y_N}\}$$ I use scipy's implementation of ...
4
votes
0answers
160 views

Numerical integration of a function of an empirical CDF

I have the following equation $y = f(x)$ and I want to invert $f(\cdot)$ to find $x$ numerically. Because the function $f(\cdot)$ is quite complex I will solve $y - f(x) = 0$ instead, using the ...