Math Genius: Integral of product of 3D Gaussians

Original Source Link

I am reading a paper, Keep it SMPL: Automatic Estimation of 3D Human Pose and Shape from a Single Image, CVPR 2016, that models the human parts with capsules for estimating the interpenetration penalty and then abstracts that with 3D Gaussians which corresponds to the bones (for calculating the intersection of parts estimated with 3D spheres because calculating the volume of intersecting capsules is very much challenging).

There’s this formula in the paper that I can’t wrap my head around it.

enter image description here

In this formula, that is for integral of the product of Gaussians corresponding to incompatible part, specifically, I don’t understand the following part (I understand what C_i(theta, beta), C_j(theta, beta), sigma_i^2, and sigma_j^2 are):

enter image description here

I understand that product of two Gaussians does have exp as well as sigma_i^2 + sigma_j^2 in the denominator of exp. However, I don’t understand why we are using the norm 2 squared of the difference of centers in the nominator of exponential function??

Below, I have added screenshots from the paper that goes over the formula (however, mathematically, it is still not clear to me how we arrived at this formula)

enter image description here

enter image description here

I reformulated your kernel as follows:
E(theta;beta)=sum_isum_j exp(frac{(C_i – C_j)^p}{sigma^2_i+sigma^2_j})

The smoothness parameter $p$ affects the correlation trend between $C_i$ and $C_j$. Suppose we test $p=0.1, 1, 2$. So $p=0.1$ makes the correlation to be near discontinuity between $C_i$ and $C_j$. For $p=1$, we have a non-differentiable kernel which might be useful for non-differentiable functions, and for $p=2$ we have a smooth basis function which is differentiable for all orders. Although you fix the parameter $p$ for all of your dimensions, it can be estimated for every dimension. For $p=2$, we have a squared exponent function.

Tagged : / / / /

Math Genius: Distribution of the entries of a particular matrix product

Original Source Link

Let us assume a Complex Gaussian i.i.d. matrix $A$ which can be decomposed using the SVD into $A=UDV^*$, where $U$ and $V$ contain the left and right singular vectors, respectively, and $D$ is a diagonal matrix with the singular values on its diagonal.

The matrix $A$ can also be written as $A=U_k D_k V_k^*+U_m D_m V_m^*$, where $U_k$ and $V_k$ correspond to the first $k$ columns of $U$ and $V$, respectively, and $U_m$ and $V_m$ correspond to the last $m$ columns of $U$ and $V$.

I’m interested in the product $U_k^* A=D_k V_k^*$, in particular the distribution of its elements.
Is such a derivation available anywhere? Perhaps a similar problem has been analyzed?

Thanks in advance!

Tagged : / /

Math Genius: About the ERF function (Characteristic Function of the Gaussian Distribution)

Original Source Link

Can someone explain to me why that is an $frac{1}{2}$ multiplying the result of this integral (I think I can understand the rest. I did the calculations, but can’t find this $1/2$):

$$ int frac{1}{sqrt{2pisigma}} e^{ikx – x^{2}/2sigma} dx = -frac{1}{2} i e^{-k^2sigma/2} operatorname{erfi} bigg( frac{ksigma + ix}{sqrt2sqrtsigma} bigg) $$

where the $ operatorname{erfi} $ is the imaginary error function defined by:

$$ operatorname{erfi} (z) = -i operatorname{erf} (iz)$$

You can go to wolfram alpha to see what I’m talking about (copy and paste the following):

integrate (1/((2*pi*o)^(1/2)))e^(ik*x – (x^2/(2*o))) dx

Note: I know that are other ways to obtain the Characteristic Function of the Gaussian Distribution, this is just a curiosity that emerged from doing $ g(k) = langle e^{ikx} rangle$.

There are two things going on. First, the $exp(-x^2)$ versus the $exp(-x^2/2)$ in the integrands of the physicists’ $operatorname{erf}$ function and the probabalists’ $Phi$ function induces some change-of-variables scale factor. Second, the fact that $sup_{x,y}|operatorname{erf}(x)-operatorname{erf}(y)|=2$ but $sup_{x,y}|Phi(x)-Phi(y)|=1$, which is to say, the $operatorname{erf}$ function is not a cumulative distribution function. Keeping track of these differences is a matter of careful bookkeeping, the bottom line of which is your $1/2$.

In summary, the $1/2$ is an artifact of using the $operatorname{erf}$ function, part of the “cost of doing business” that way. See the Wikipedia page on the normal distribution for further details. Probabalists work with the normal density $varphi(x)=exp(-x^2/2)/sqrt{2pi}$ and its indefinite integral $Phi(x)=int_{-infty}^xvarphi(t),dt$. You can check that $Phi(x)=(1+operatorname{erf}(x/sqrt 2))/2;$ that’s the source of your $1/2$.

Tagged : / /

Server Bug Fix: CCSD(T) Transition State and Ground State Calculations in Gaussian09: “Unable to Determine Lambda”?

Original Source Link

I’m doing CCSD(T) calculations (for both transition and ground state geometries) on a series of small molecules in Gaussian09. Several similar calculations terminated without any problems but one TS calculation and one ground state calculation gave me this error after about 20 minutes.


Without these remaining calculations, several months’ worth of work is incomplete. I will appreciate any suggestions. I’ve searched a lot of chemistry forums, but nobody seems to know the solution.

Here’s my route section for the TS calculation:

#p opt=(ts,z-matrix,noeigentest) freq=noraman rccsd(t)/genecp nosymm maxdisk=15950MB

Route section for the ground state calculation:

#p opt=(z-matrix,noeigentest) freq=noraman rccsd(t)/genecp maxdisk=15950MB

It’s not a terribly descriptive error message, but this occurs when you reach the max number of iterations for the Eigenvector Following (EF) algorithm and still haven’t converged a lambda. While Gaussian uses a different approach (the Berny Algorithm) for methods which have analytical gradients, CCSD(T) is one of the few methods for which these still aren’t implemented, so it has to use EF to find minima/saddle points.

This page gives a mathematical description of the algorithm showing what lambda means in this context (note, the page is for QChem, but the underlying algorithm should be more or less the same in both programs).

There is probably a more in depth solution to your problem, but I’m not the one to give it and it would probably require a bit more knowledge about your system. However, for now you can try adding iop(1/6=N) to allow it to try more iterations (see here) There might be an iteration count somewhere in your output, but otherwise the default number of steps can’t go higher than 40 regardless of system size, so maybe set N to something >40.

Also, if you haven’t already, try to find your minima/saddle point with a lower level of theory first (e.g. DFT, MP2, CCSD) and use this as your starting geometry.

Tagged : / /

Math Genius: demonstration about a particular triple integral

Original Source Link

i have the following integral

$L=int_{-infty }^{infty}(int_{x_{1}}^{x_{2}}(int_{-f(x)}^{f(x)}g(t)dt)dx)dmu$

where $f(x)$ is a convex function defined only in the interval $x_1<x<x_2$ and $g(t)$ is a gaussian function with rms $sigma $ and mean value $mu$. Please note the integral over $mu$.

Is it possible to demonstrate that the value of $L$ does not depend on the value of $sigma $ ?

Best regards


Tagged : / /

Math Genius: Convexity of Gaussian Q-function (monotone decreasing)

Original Source Link

I have a known convex function. If I take the Gaussian Q-function of this convex function would the resultant function also be convex?

No, this is not even true when the convex function is $x$.

$1-Phi(x)$ is not convex when $x < 0$. This can easily be seen by looking at the 2nd derivative of $1-Phi(x)$, which is $frac{x}{sqrt{2pi}} text{exp}(-x^2/2)$.

Tagged : / / / /

Math Genius: How to get a “Gaussian Ellipse”?

Original Source Link

Assume I have a multidimensional Gaussian distribution defined by a mean $mu$ and covariance matrix $Sigma$. I want to calculate an iso contour / ellipsoid that is aligned with the shape of the PDF.

i.e like this:

enter image description here

Or like the projected region in this image:

enter image description here

In more general terms, is there an easy way to define the isocontour of a Gaussian function for plotting?

In $n$ dimensions, the $text{pdf}$ is an exponential function of

$$(p-mu)^TSigma^{-1}(p-mu)$$ and the isocontours are the (hyper)ellipses of equation


By diagonalizing $Sigma^{-1}$,

$$(p-mu)^TPLambda P^{-1}(p-mu)=l,$$ where $P$ should be taken orthogonal to correspond to a pure rotation.

In the transformed coordinates,

$$t^TLambda t=l,$$

leading to the classical 2D case,


This can be drawn by the parametric equations

$$begin{cases}x=dfrac l{sqrt{lambda_u}}costheta,\y=dfrac l{sqrt{lambda_v}}sintheta,end{cases}$$
then reverting to the original coordinates.

For the 3D case, you have the option of using spherical coordinates

$$begin{cases}x=dfrac l{sqrt{lambda_u}}costhetasinphi,\y=dfrac l{sqrt{lambda_v}}sinthetasinphi,\z=dfrac l{sqrt{lambda_w}}cosphiend{cases},$$ giving a system of meridians and parallels.

You also have the option of freezing one coordinate at a time to obtain a triple network of elliptical cross-sections of equation

$$frac{lambda_u}lu^2+frac{lambda_v}lv^2=1-frac{lambda_w}lw^2,$$ i.e.

and similar for the other axis.

For the 3D representation, the points undergo both the diagonalizing and the viewing transformations. The latter is usually made of a rotation, a translation and possibly a perspective projection, and the two rotations and translations can be combined.


For 4D, projecting a wireframe from 4D to 2D will be completely unreadable. You can think of using time as the fourth dimension, and consider constant-time cross-sections, such that the fourth coordinate of $p$ is held constant.

Here things get a little more complicated as the above condition translates to a hyperplane equation in the diagonalized coordinates, and you will have to construct the intersection(s) of a hyperellipsoid and this hyperplane obtained by sweeping over time. This will result in a set of 3D ellipsoids that you can render by the above method. Beware anyway, that the center is not fixed.

The movie will show an ellipsoid inflating from a single point, with its center moving along a line segment (not necessarily a main axis). After meeting the middle point, it will deflate symmetrically and vanish.

In the 4D diagonalized coordinates, the hyperellipsoid will look like
and the constant-time constraint will be write

Hence by eliminating a coordinate, say $t$, we get the ellipsoid

The axes are the eigenvectors of the covariance matrix; the semi-axes are (proportional to) the reciprocals of the eigenvalues of the covariance matrix.

Tagged : / / /