A function f(x) is said to be in Lp if the integral of |f(x)|p is finite. So if you know f is in Lp for some value of p, can conclude that f is also in Lq for some q?…

A function f(x) is said to be in Lp if the integral of |f(x)|p is finite. So if you know f is in Lp for some value of p, can conclude that f is also in Lq for some q?…

Here’s a common problem that arises in Bayesian computation. Everything works just fine until you have more data than you’ve seen before. Then suddenly you start getting infinite, NaN, or otherwise strange results. This post explains what might be wrong…

Define the integration operator I by so I f is an antiderivative of f. Define the second antiderivative I2 by applying I to f twice: It turns out that To see this, notice that both expressions for I2 are equal…

Suppose you want to evaluate the following integral: We’d like to do a change of variables to make the range of integration finite, and we’d like the transformed integral to be easy to evaluate numerically. The change of variables t…

Today I needed to compute an integral similar to this: I used the following SciPy code to compute the integral: from scipy.integrate import quad def f(x): return 0.01*x**-3 integral, error = quad(f, 1000, sp.inf, epsrel = 1e-6) print integral, error…

My favorite numerical analysis book is Numerical Methods that Work. In the hardcover version of the book, the title was impressed in the cover and colored in silver letters. Before the last word of the title, there was another word…

When I solve a problem by appealing to symmetry, students’ jaws drop. They look at me as if I’d pulled a rabbit out of a hat. I used think of these tricks as common knowledge, but now I think they’re…

The trapezoid rule is a very simple method for estimating integrals. The idea is to approximate the area under a curve by a bunch of thin trapezoids and add up the areas of the trapezoids as suggested in the image…

Someone sent me a link to an optical illusion while I was working on a math problem. The two things turned out to be related. In the image below, what look like blues spiral and green spirals are actually exactly…

Sometimes when people say they want random points, that’s not what they really want. Random points clump more than most people expect. Quasi-random sequences are not random in any mathematical sense, but they might match popular expectations of randomness better…

This weekend CodeProject posted an article I wrote entitled Fast numerical integration. The algorithm in the article, introduced in the 1970′s by Masatake Mori and Hidetosi Takahasi, is indeed fast. It integrates analytical functions over bounded intervals with the most accuracy for…

The first post in this series introduced random inequalities. The second post discussed random inequalities can could be computed in closed form. This post considers random inequalities that must be evaluated numerically. The simplest and most obvious approach to computing…

My previous post introduced random inequalities and their application to Bayesian clinical trials. This post will discuss how to evaluate random inequalities analytically. The next post in the series will discuss numerical evaluation when analytical evaluation is not possible. For…

Sometimes a good diagram is a godsend, reducing the entropy in your head at a glace. When I was studying integration theory, I ran across a diagram something like the following in the out-of-print book Elements of Integration by Robert G.…

Today I needed to use Fibonacci numbers to solve a problem at work. Fibonacci numbers are great fun, but I don’t recall needing them in an applied problem before. I needed to compute a series of integrals of the form f(x, y)…