@MISC{Kalvelagen02gams/fitpack:spline, author = {Erwin Kalvelagen}, title = {GAMS/FITPACK: Spline Interpolation with GAMS}, year = {2002} }

Share

OpenURL

Abstract

This document describes how the high quality and robust curve fitting routines in FITPACK[7, 8, 9] can be used from a GAMS environment. The system uses the external function capabilities of GAMS which allows us to call external functions packaged as a DLL (dynamic link library). The same DLL is used as a back-end for a simple visualization tool that can be used to inspect the quality of the fit. 2 Interpolation Interpolation can be useful in several cases. An obvious situation is where the modeler does not have access to an analytic functional form, but just a number of data points. Another case is when there is a functional form, but when limitations in the GAMS syntax do not allow you to express this form. An example of such a case is an actual piecewise function. Even if such a function is continuous and di#erentiable, GAMS syntax does not allow you to express it. A simple example is the Huber M-function. 2.1 An example: the Huber-M function Least squares estimation is not robust in the sense that the estimation results are very sensitive to outliers. A Mean Absolute Deviation (MAD) approach which does not minimize the squares of the residuals but rather the absolute residuals is often suggested as an alternative. MAD models can be solved by using Linear Programming (see e.g. [3, 6]). Huber-M regression is a combination of the previous two appraoches. The Huber M-estimation problem is stated as: # GAMS Development Corporation, Washington D.C. 1 M-ESTIMATION minimize # # i #(# i ) subject to y i = # j x i,j # j + # i where #(.) is defined as #(# i ) = # # 2 i if |# i | # k 2k|# i | - k 2 otherwise (1) for some k > 0. Figure 1: Graph of the function #(x), k = 1.5. Although this model is perfectly smooth and has continuous derivatives it is not e...