Daily Download 14: Curve Fitting 1

Today’s download topic covers fitting a straight line or curve to scattered data, using the “least squares” method.  Fitting a spline curve to pass exactly through a series of points will be covered in a few days.

Use of the LinEst function, and differences in the results compared with the chart based fitting function was described in : Chart Trend Lines and the Linest Function
Download file: http://interactiveds.com.au/software/LinEst%20Check.zip

The LinEst function can also be used to fit certain curves (such as polynomials, exponential, power and logarithmic functions) to a set of data, as described at: Using LINEST for non-linear curve fitting

This technique was extended for data with gaps in: Using LinEst() on data with gaps
Download file: http://www.interactiveds.com.au/software/Linest-poly.xls

Fitting high order polynomials can give unexpected results, as described at: Fitting high order polynomials.  The ALGLIB library was found to give much more stable results than using the LinEst function for polynomials of 5th order and higher.  VBA interface functions allowing the ALGLIB functions to be used from Excel are described at: ALGLIB linear and polynomial fitting functions.  These functions are included in the AL-Spline-Matrix download files below.

Non-linear regression using the Excel Solver was covered at: Non linear regression – 1 and using the ALGLIB Library at Non linear regression – 2; ALGLIB functions
Download files: http://interactiveds.com.au/software/NonLinFit-Solver.xls
http://interactiveds.com.au/software/AL-Spline-Matrix07.zip
http://interactiveds.com.au/software/AL-Spline-Matrix03.zip

Using LinEst with polynomial curves

Regression for data with gaps

Fitting 7th order polynomial

ALGLIB Polynomial fitting functions

Non-linear regression with the Excel Solver

ALGLIB non-liner curve fitting output

Posted in AlgLib, Charts, Excel, Maths, Newton, UDFs, VBA | Tagged , , , , , , , | Leave a comment

Daily Download 13: The ALGLIB maths library and Excel

Today we move onto maths related downloads, starting with the ALGLIB maths library, which has featured here quite frequently:

Original post with link to site: ALGLIB

Installing AlgLib with Excel VBA
Download files: http://interactiveds.com.au/software/AL-Matrix-xlsb.zip   http://interactiveds.com.au/software/AL-Matrix-xls.zip

Linking AlgLib C++ to Excel VBA
Download file: http://interactiveds.com.au/software/AL-Matrixdll.zip

Compiled AlgLib Matrix Functions for Excel
Download file: http://interactiveds.com.au/software/AL-Matrixdll2.zip

ALGLIB Statistics Functions
Download file: http://interactiveds.com.au/software/AL-Stats.zip

AlgLib Complex Number Functions
Download file: http://interactiveds.com.au/software/AL-Complex.xls

AlgLib Spline Functions
2D Spline Interpolation with ALGLIB
Download files: http://interactiveds.com.au/software/AL-Spline-Matrix07.zip  http://interactiveds.com.au/software/AL-Spline-Matrix03.zip

Note that all the spreadsheets listed above link to Ver 2.6 of the ALGLIB library, which is the latest release in VBA.  At some stage I will link to later versions, which are available in C++, C#, VB.Net, and various flavours of Python, but the currently available VBA library remains a valuable resource, greatly extending the maths functionality available directly from Excel, and offering far better performance for maths intensive operations such as matrix functions.

Update Dec 2013:

Functions linking to the C# version of Alglib can be found at Compiled Matrix Functions for Excel; download file: http://www.interactiveds.com.au/software/Matrixdll-c%23.zip

For those wishing to use any of the ALGLIB routines in commercial applications, please read and observe the Licence Agreement

Matrix Functions

Matrix Functions

Statistics Functions

2D Spline Functions

Posted in AlgLib, Arrays, Excel, Maths, Newton, Numerical integration, UDFs, VBA | Tagged , , , , , , , | 7 Comments

Daily Download 12: ImageMagick and Excel

Today’s download provides a simple way of adding images to Excel from a list of file names, using the freeware program ImageMagick.
See ImageMagick and Excel and ImageMagick – Update and add IrfanView link

Download file:  http://www.interactiveds.com.au/software/PastePic.zip

Posted in Computing - general, Excel, VBA | Tagged , , , | 1 Comment

Daily Download 11: Perspective Projection

The last of the daily downloads dealing with drawing is an extension of the drawing spreadsheet providing 3D perspective projection of wireframes defined by lists of 3D coordinates and connected points.  The spreadsheet was described in:Drawing in Excel 9 – Perspective Projection and the download files are:

http://interactiveds.com.au/software/Plotxyz-xlsb.zip
http://interactiveds.com.au/software/Plotxyz-xls.zip

This was used to plot a Buckyball in: Drawing a Buckyball in Excel , with download file:

http://interactiveds.com.au/software/PlotBuckyBall.xlsb

Posted in Drawing, Excel, VBA | 1 Comment

Daily Download 10: Excel Digitiser

See How to digitise a scanned image and Digitising logarithmic scales.  This spreadsheet provides a function to retrieve coordinates of lines traced over a scanned image.

Download from: http://interactiveds.com.au/software/DigitGraph.zip

Example images:

Posted in Drawing, Excel, Newton, UDFs, VBA | Tagged , , , , | Leave a comment