|
|
The following source code
(Visual Basic/VBA) will give you an example of how easy it is to use DataFitX. There are
example source code/projects for Visual Basic, Visual Basic .NET, Visual C++, Visual C++
.NET, Visual C# .NET, Microsoft Excel, VBScript and Delphi in the download
area of our website, as well as on the installation CD shipped with the product. Dim dfxData As DataCollection
Dim dfxModel As NonlinearRegression
Dim dfxParameter As RegressionParameter
'Create an instance of the DataCollection
Set dfxData = New DataCollection
'Import 2 named tab-delimited columns of data
'(Time and Magnetism) from an ascii file.
dfxData.ImportNamedSeriesFromFile "c:\input.dat", dfxDelimiterTab
'Prepare the series for regression. "Time" is the independent
'variable X, "Magnetism" is the dependent variable Y.
dfxData.Item("Time").RegressionKey = "X"
dfxData.Item("Magnetism").RegressionKey = "Y"
'Create an instance of dfxModel
Set dfxModel = New NonlinearRegression
'Define the pre-defined model Y = a+b/x+c/x^2+d/x^3
'(ModelID = 18)
dfxModel.DefineInternalModel 18
'Fit the model to the data
dfxModel.FitCollection dfxData
'Display the parameter results
If dfxModel.IsSolved Then
For Each dfxParameter In dfxModel.RegressionParameters
MsgBox dfxParameter.Name & " = "
& dfxParameter.Value & " +/- "
& dfxParameter.CIDelta(95)
Next dfxParameter
'You can use many of the other properties to obtain detailed
results. For example, display the R2 value:
MsgBox "R2 Value = " & dfxModel.R2
Else
dfxModel.SaveLog "c:\log.dat"
MsgBox "Solution failed, view the log file."
End If
Order it now, or try it for yourself.

| Home | Products | Services | Download | Order | Support
| Contact |
Copyright © 1995-2008 Oakdale
Engineering. All Rights Reserved.
|