- Purpose
This app can be used to fit a large number of datasets from a worksheet sequentially and speedily, and create a simple report table of parameter values and fit statistics.
Features include:
- Fit all XY (YErr) datasets in the active worksheet
- Perform linear, polynomial and nonlinear fit using different algorithms
- Preview of fitted curve for current dataset with 95% confidence band and 95% prediction band
- Select a built-in or user-defined function for nonlinear fit
- Three choices for parameter initialization for nonlinear fit:
- Initialize each dataset independently
- Use fit values from previous dataset as initial parameter values for next dataset
- Use custom (user-specified) initial parameter values for all datasets
- Output parameter values, standard errors, dependencies etc and also output fit statistics including fit status
- Output the fitted curve, and allow go through each dataset by the navigation buttons on the fitted curve graph
- Use metadata elements such as long name or comments as dataset identifier in the output sheet
- Installation
Download the file "Speedy Fit.opx", and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps gallery window.
- Operation
- Import desired data into a worksheet. Make sure that column designations are set correctly (such as XYY..., XYXY.... XYYer... etc)
- With worksheet active, click the icon in the Apps Gallery window.
- In the pop up dialog, the Current Data is the first Y data of the active worksheet, and the preview of fitted curve shows in the right side of the dialog.
- Select a tab to decide what fitting to perform.
- For nonlinear fit, select the fitting function, and the desired method for parameter initialization.
- Optionally enter custom initial values, fix status, and lower/upper bounds for parameters in the table.
- Choose the parameter values and statistics you want to output by clicking Report Settings button.
- Click OK button to perform the sequential fitting.
- For large number of datasets, a progress bar will be displayed, including information on what percentage of datasets were successfully fitted.
- You can quit the fit process in the middle. Results up to that dataset will still be available in the output sheet.
- Dialog Settings
- Linear Tab
- Current Data: The current data from worksheet for preview, change it to check the result of the one you want.
- Weighted Fit: If the current data has error, this checkbox is available for whether to perform weighted fit.
- Table: Show the fitted results of the current data, and you can fix intercept or slope.
- 95% Confidence Band: Show 95% confidence band on preview of fitted curve.
- 95% Prediction Band: Show 95% prediction band on preview of fitted curve.
- Polynomial Tab
- Current Data: The current data from worksheet for preview, change it to check the result of the one you want.
- Weighted Fit: If the current data has error, this checkbox is available for whether to perform weighted fit.
- Order: Select the order of polynomial fit.
- Table: Show the fitted results of the current data, and you can fix intercept.
- 95% Confidence Band: Show 95% confidence band on preview of fitted curve.
- 95% Prediction Band: Show 95% prediction band on preview of fitted curve.
- Nonlinear Tab
- Current Data: The current data from worksheet for preview, change it to check the result of the one you want.
- Weighted Fit: If the current data has error, this checkbox is available for whether to perform weighted fit.
- Category: Select the category of fitting function.
- Function: Select the fitting function from the specified category.
- Parameter Initialization: Specify how to initialize parameters when perform sequential fit. Options include:
- Initialize for Each Dataset: Initialize each dataset independently.
- Use Fit Values from Previous Dataset: Use fit values from previous dataset as initial parameter values for next dataset.
- Use Custom Values for All Datasets: Use custom (user-specified) initial parameter values for all datasets.
- Iteration Algorithm: Choose what algorithm is used for iteration, including Levenberg Marquardt and Orthogonal Distance Regression.
- Table: Show the fitted results of the current data, and you can change the values to change the intial values, fix parameters and change lower/upper bounds. If Parameter Initialization is Use Custom Values for All Datasets, the manually changed parameter values (not the values from clicking 1 Iter. or Fit button) in this table is used for each data when performing sequential fit.
- Apply to All Datasets button: This is button is shown when Parameter Initialization is Use Custom Values for All Datasets. Clicking this button, the initial parameter values in the table for current dataset will be applied to all other datasets.
- Hold as Initial Values button: This is button is shown when Parameter Initialization is Use Custom Values for All Datasets. When you have performed the fitting by clicking 1 Iter. button or Fit button, the fitted values of current status will be shown in the table. Then clicking this button will keep current fitted values as initial parameters.
- 95% Confidence Band: Show 95% confidence band on preview of fitted curve.
- 95% Prediction Band: Show 95% prediction band on preview of fitted curve.
- Preview All Plots: This checkbox is shown if the data is from graph. If checked, all plots in the graph will show for preview, otherwise, it only shows the current plot for preview.
- Buttons
- Previous Data: Change the current data to the previous one in worksheet.
- Next Data: Change the current data to the next one in worksheet.
- Report Settings: Choose the parameter values and statistics you want to output. For more details, please refer to Quantities to Compute.
- Reinit: For nonlinear fit only. It is to reinitialization the parameters.
- 1 Iter.: For nonlinear fit only. Perform 1 iteration with current parameter values.
- Fit: For nonlinear fit only. Perform iterations until the max number (400) of iteration is reached, or meet the tolerance.
- OK: Perform sequential fit on all datasets in worksheet, and output results.
- Cancel: Do nothing and close dialog.