[ADMB Users] Spline advice sought

Mark Payne mpa at aqua.dtu.dk
Mon Oct 3 13:42:00 PDT 2011


Dear ADMBers,

I have a problem that I was hoping that some of you might be able to give me some advice on.

The situation is that I have a time-series of ten years of daily data (with a substantial number of missing values and some large gaps) that I would like to smooth by fitting a spline to. I have been doing this using ADMB by specifying (monthly) knots as parameters to optimise, and then using the vcubic_spline function to estimate the value of the individual observations at the appropriate time. I then write a likelihood function comparing the fitted and observed values....

The problem that I have is that I can't make the spline "taunt" enough ie depending on how the data sits, the spline has a bad habit of twisting itself up into very steep hairpins and loops that fit the data well, but at the same time don't really make that much "sense" visually or physically. What I'm looking for is a way to achieve a "smoother" fit - I realise that that is a very subjective thing, but that's also why I'm asking for advice....

I believe the problem is that I am giving the individual knots too much freedom - in the current configuration each is allowed to take on essentially any value it likes, independent of all the others, constrained only by the net effect that changes have on the fit. However, when I talk about the "smoothness", I guess I'm saying that I'm looking to include correlation between points that are close together. The problem is that although I get the idea, I don't exactly know how to do this in terms of implementing it in ADMB....

So, what I was wondering was
1. Is what I propose the most sensible approach? Or are there better ways to fit a spline that is nice and smooth?
2. If so, how do I actually implement this? Does anyone have any examples they could share?

Best wishes,

Mark


More information about the Users mailing list