You can call me Nigel.
My model is a kriging/surrogate/proxy/radial basis function/Guassian process model.
In fact in the example I have been using, there are about 300 models, and the overall likelihood calculates the likelihood for each individual model.
Each individual model is based on about 600 big engineering simulation runs (which can each take 24 hours in some cases).
I use Matern correlation functions which take some time, and calculating the derivatives was fun.
So for the overall likelihood function calculation I do about 300 Cholesky solves with a 600 x 600 triangular factor. The derivative calculation takes about the same time as a function evaluation.
I do it all in heavily multi threaded Java code.
Re NUTS - I did changes to the epsilon as mentioned below, and it definitely improves things. Giving the epsilon a jolt if it gets stuck at small values help a lot. The gamma distribution may also help. Being in commerce, I don't do days and days of testing, I use my instincts a lot.
Next stage I think will be to run parallel DE chains and do some cross fertilisation a la tempering.
BTW, I find that out of the box it takes of the order of 1000 leap frog steps per iteration, so there is plenty of scope for using an approximate hessian. Using the Hessian will also make it less sensitive to the size of the momentum gaussian distribution, which is very critical.
The BFGS paper is not as well known but is also very nice work - Zhang and Sutton.
On Friday, 31 August 2012 20:44:31 UTC+1, Bob Carpenter wrote:
4. Better Hessian/mass matrix.
A diagonal mass matrix is no use to me, but recent studies using BFGS and/or Reimann manifold may be  beneficial. They
may not, Â however, help the multi mode issue. I have tried NUTS with a simple highly correlated multivariate gaussian
distribution with an exact weight matrix, and the efficiency improves drastically.
It can be applied to discrete parameters, although I haven;t tried this yet - I will need the capability in the near future (i.e. next week).
The main issue is that the basic approach needs 2 x N chains, but more recent work has helped. As I sometimes have 400 parameters, this is an issue. Even with 16 parameters (which is for me on the very small side), 32 chains is quite a lot. I tend to use 8 chains, it used to be so that each chain can be on a separate CPU core, but I am doing it differently now and 8 just seems a sensible number.
A lot of the ideas come from the differential evolution method in heuristic optimisation, which I have used a lot and found very useful (much better than the 'conventional' GA operators). It works, but nobody knows why!
I am pretty familiar with NUTS, having converted it from Matlab to Java (not trivial with the recursion!).
The jiggling of epsilon I am referring to is in lines 156-161 of nuts.hpp, and if I understand it, the jiggling only happens AFTER burn in, which is what I was wondering about. Have I understood correctly, and is there a reason for this? It seems strange - I definitely want to jiggle during burn in, otherwise I will never get out of burn in.
The papers on DREAM are well worth the effort, and Gregory has found it very useful for his work finding aliens. Look up Gregory and FUSION, he is from Toronto, and has similar background to me (I also did theoretical physics PhD at Manchester).
My Java code for jiggling with a gamma distribution, using apache Java code for the gamma, is:
double shape = 2.0;
double scale = 1.0;
GammaDistributionImpl aGammaDistributionImpl = new GammaDistributionImpl(shape, scale);
for (int iChain = 0; iChain < nChains; iChain++) {
try {
eps[iChain] = epsilon[iChain] * aGammaDistributionImpl.inverseCumulativeProbability(Math.random()) / shape / scale;
} catch (MathException e) {
System.out.println(e.getMessage());
}
}
Does google groups have [code] tags?
I think this is a bit 'cleaner' than asking a user to specify limits. In my tests it seems to help somewhat. Occasional small steps as well as occasional long ones. It doesn't seem to affect epsilon adaptation too much. The main problem before was that it was always rejecting trees, so epsilon kept on getting smaller, and it never got out of the local minimum.
I also implement the re finding of a reasonable epsilon. I do this if (a) the depths have hit the limit (I use a limit of 8 - does this affect ergodicity etc.?) and (b) alpha/nalpha is less than 0.01 and (c) we are still in adapting phase.
I also set mu = log(epsilon) rather than log(10*epsilon) when re finding reasonable epsilon. I also have to be careful to do this not to soon before the end of burnin, or else you will have a poor epsilon after burnin.
I also have a loop around finding a reasonable epsilon, and take the average of ten attempts. Maybe I should do more. The idea is that there will be some directions with a much longer epsilon.
Of course, a very simple approach to the hessian would be to do lots of initial attempts, similar to finding reasonable epsilon, and then construct a correlation matrix from those attempts. We have a set of vectors and a set of lengths, so it should be easy to make an approximate hessian.
I looked at Lewandowski's PhD thesis, but it will take a lot for me to fully grasp the concepts. In contrast, constructing a BFGS approximation is bread and butter for me. I do a lot of regression and model fitting, but am not a trained statistician, so copulas are unknown territory.
No doubt these tweaks could be improved, but they definitely have changed my problem from one which was getting nowhere to one which gets a reasonable solution overnight.
Goodman and Weare are unfamiliar to me, thanks for the link.
Yes, it's amazing how few lines of Matlab NUTS takes (and it explodes with all the infrastructure of Stan, which is far too much for me to have time to understand). You can see all the algorithm on the screen.
In contrast to NUTS, Fortran code such as Powell's BOBYQA (200 lines) and L-BFGS-B (4800 lines) is an order or two of magnitude more complex, albeit they have a lot of comment code.
Code for BFGS MCMC is available, in Java, but it will take me a bit of work for me to understand it. There must be a lot of duplication of functions with L-BFGS-B, which I have recently converted from Fortran to Java.
It is so easy to end up with ten different cholesky factorisation methods.....
Your epsilon estimation could also maybe benefit from some of the search length methods used in optimisation - I have had cases where your code goes into an infinite loop, so I set a max iterations in the find_reasonable_epsilon.
This behaviour can be found in the Rosenbrock example I posted on the other thread. If you start far from the minimum, it behaves badly. I was trying a dimension of 32. It would be very easy for you to try it out with Matlab NUTS.
In my real work, I do a lot of optimising to find a good starting point for sampling. But this can be dangerous, particularly if you don;t move far from that point. It results in forecast uncertainties which are too narrow.
I also do the full MCMC many times, but that is another story. But it does mean I can use my previous MCMC results to make intelligent starting points for the next time.
It's getting rather late in the UK. Gnite.
As always, it is a balance between exploration and exploitation.
There may be some useful ideas from the particle swarm literature, for which there is a well developed theory of stability and oscillations, based on eigenvalues of the transformation matrix. Some kind of inertia or dampening may be useful during burn in.
In my simple mind, if we roll a ball down the hill, we don;t want it to go all the way up the other side, but we don't want it to stop at the bottom either. We want some suitable friction or dampening. We certainly don;t want it to go round in circles like a trick cyclist.
In my optimisation work (all unpublished, it is commercially confidential), I have integrated methods from particle swarm (PSO), differential evolution (DE) and local quasi newton minimisation. It is fully integrated, not just switching from one to the other at certain iterations. These different methods all contribute usefully.
Similarly, I see HMCMC methods as being good for local search, whereas more heuristic methods like DREAM are better for global exploration.
I did start looking at whether ideas of quantum tunneling could be used with HMCMC, to go through barriers, but didn't get very far. Parallel tempering with HMCMC was, in my initial studies, too costly, but I have often thought of having one chain as HMCMC and other chains as parallel tempered DREAM.
For multi mode problems, there may be a need for multiple tunings of NUTS.
Garsaglia has done some interesting work in this area 'Evaluating the Normal Distribution' in JSS.
But even that was nowhere near enough for my tails, so I used the concept and wrote my own approximation.
You can see from that paper how to get log cum norm approximations at extreme tails.