julia

Today I dug a little deeper than I expected into some regex parsing for the AstroAngles.jl package. I wanted to detail the way I approached the problem and the solution I landed on (in hopes that someone will come along and tell me how much better it could have been). Sexagisimal and Angles In astronomy, we represent the coordinates of things on the sky using angles. This is convenient because we can essentially look at the sky as a big sphere with us at the middle and form a coordinate system similar to our latitude and longitude system.
2021-04-22
6 min read
Recently I’ve been thinking about the LogSumExp trick since it is used in the integration step of nested sampling. I won’t go over too much of the math here, but the reason this trick exists is to greatly increase the numerical stability of the operation $$ \log \sum_i \exp x_i $$ via the identity $$ a + \log \sum_i \exp\left(x_i - a\right) $$ Naive implementations In Julia we can implement a naive logsumexp with logsumexp_naive(X) = log(sum(exp, X)) let’s test the numerical accuracy against Julia’s BigFloat for some very large numbers
2021-04-19
3 min read