LibLip Maple toolbox
School of Engineering and IT, Deakin University, Australia
Copyright Gleb Beliakov, 2006
Australia
gbeliako@gmail.com
Installation instructions
To use this worksheet you need to have MapleLibLip.dll library in the curent directory or on the path
Introduction
This worksheet illustrates how LibLip package can be used with Maple (under MS Windows).
LibLip is a programming library for interpolation and smoothing of multivariate scattered data with Lipschitz functions.
Please see the user manual supplied with this worksheet.
This worksheet is provided as a template for user's own calculations. It shows how to declare the data and
supply it to LibLip methods.
It should be used in conjunction with the supplied dll (MapleLibLip.dll), and the user manual (liblipmaple.pdf).
The typical calling sequence is as follows:
1. execute define_external procedures in the next subsection
2. Define your data
3. call the relevant interpolaiton routines with correct arguments
Please change the LIBLIPPATH line below to the location of this package on your computer!
Initialization: Declarations of LibLip procedures found in the dll
Execute the commands below to declare the external subroutines from LibLip library.
Section 1: Generation of the data and its interpolation
We need to declare two arrays: abscissae XD and function values YD. We will generate the data using some test function (you may change it)
Declaration of the function f(x) that generates the data
Declare f as a procedure.
Generating the data (random abscissae, uniformly distributed in the domain)
Boundaries, and also the dimension of x and declaration of various vectors.
Executing LibLip methods to approximate function values
Interpolating the data: choose any random vector X and calculate the value of f
Compute the Lipschitz constant from the data
Plot the interpolant together with the data. We define an auxiliary function for this
Now use a different method of locally Lipschitz functions
The next section gives an example of smoothing noisy data
Smoothing noisy data
We shall use the same data with some added uniformly distributed noise
Add noise to the data
Let us plot the interpolant of the noisy data, to see that it is really inadequate
Smoothing using a desired Lipschitz constant
Plot interpolant of the smoothened data
Notice that we use TD (the array that contains smoothened data) rather than YD
Next we determine the Lipschitz constant automatically by using sampe splitting
Determining the Lipschitz constant
The estimation routine has already computed the Lipschitz constant, and has smoothened all data (it returned array TD)
Using very fast interpolation method with preprocessing, with much more data
Observe the speed with which this method generates the surface. If you change STCValue to STCValueExplicit in the libe below, the calculation time will be much higher
Section 2: Mootone interpolation
We illustrate monotone interpolation on an example of a monotone increasing function in x1 and decreasing in x2
Generate data by using a monotone function
The commands below just generate the data to interpolate
Interpolation and approximation
First calculate the Lipschitz constant, then plot the interpolant with no monotonicity constraints
The interpolant above is not necessarily monotone, but we can impose monotonicity as shown below (using LipIntValueCons command)
Next we impose monotonicity only in part of the domain, namely for x1,x2 <=0.5 (left region, shaded)
Section 3: Reading data from a file and its interpolation
The following commands just read some data from a text file
The next command calculates the local Lipschitz constants
It looks like the data are monotone, and the interpolant is not. Next we impose monotonicity constraints, and the result
Section 4: Another example, now using bounds on function values
Next we define the upper and lower bounds on function values. Note that the last (dim+1)-st argument is the parameter containing the Lipschitz constant
In the above plot, the graph of the function must lie between the red and blue surfaces. Next generate the data with noise
Now we smooth the data, and ensure they also satisfy low(x)<y<up(x)
Plot the surface and the original (red croses) and smoothened data (black dots). It lies between the upper and lower bounds as required
The bounds also work when estimating the Lipschitz constant from noisy data using sampl splitting or cross-validation
To clear the bounds use command below. You can plot the graph of the interpolant again to see that it does not satisfy the bounds anymore
References
The methods implemented in LibLip are based on the results outlined in:
Beliakov, G., A review of applications of the Cutting Angle methods, in Continuous Optimization, A. Rubinov and V. Jeyakumar, Editors. 2005, Springer: New York. p. 209-248.
Beliakov, G., Interpolation of Lipschitz functions. J. of Comp. and Applied Mathematics, 2006. 196: p. 20-44. Beliakov, G., Monotonicity preserving approximation of multivariate scattered data. BIT, 2005. 45: p. 653-677.
Please cite these papers when you need to reference LibLip
Please consult http://www.deakin.edu.au/~gleb for updates.
We appreciate your comments about your experiences using LibLip and this Maple toolbox. Please send your feedback to
This project was carried out with the assistance of Ilya Khriapin, which is greatefully acknowledged.
Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.