OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

Fitting Date and Time Data

Experimental data is frequently a function of time, which may be expressed in units of calendar date (e.g. 4/1/2007). For calculations, Origin internally uses the Julian Day Number, which is a large positive number such as 2.45419E6.

For experiments of normal duration the internal representation of the dependent variable in terms of Julian dates will consist of large positive numbers that differ only in the last one or two significant digits. Extensive calculations such as the Levenberg-Marquardt method in nonlinear fitting are unlikely to converge due to a loss of numerical precision.

This may be avoided by normalizing the independent variables X to the earliest date. So a new independent variable X-prime is created such that X-prime = X - Date(earliest date) where Date is the Origin function for converting the calendar date to a Julian date. You can then perform the curve fitting operation using this new X column and your raw Y data column. Note that the results will then be based on the normalized X values. To plot the fit curve on top of the raw data you should add the offset back to the X column of the fit worksheet. Furthermore, the X column type should be set as Date in the case of time series data.

The example below illustrates how to use the Date() function in set column value dialog to create the normalized date dataset:

Image:Fitting Date and Time Data 01.png

This normalization technique may be used whenever performing calculations with large positive numbers that differ only in the last one or two significant digits.