Using the Linear Fit Filter


The linear fit filter is the first filter that was added to SwiftVis that puts more than one filter into the GUI. There are some issues that need to be described when workng with these filters along with a general description of how the filter works. As the name implies, the linear fit filter is intended to allow SwiftVis users to do linear regression to do fits to data. The data comes from a single source. The fit can be done using any formula of the form y(p,v)=A*f_1(p,v)+B*f_2(p,v)+... The y and various f functions are basic data formulas and as such you can enter any function of the parameters or values for the input data source. The filter will find the values of A, B, ... that provide the best fit.

The linear fit filter is actually two filters because it needs to output two different sets of data. The first set of data is a single element with v[0]=A, v[1]=B, ... The second set of data includes the input data as well as the value of y(p,v) for all the elements and the fit for that data. The first output can be used to put labels in plots showing what the formula is that fits the data. The second output can be used to plot the fit next to the data.

The interface for the linear fit filter allows you to type in the formula for y(p,v) directly. You are also able to add or remove terms from the sum and enter formulas for each of those.

This tutorial was made using SwiftVis version 0.1.1. Some aspects might be slightly altered in newer versions. The linear fit filter was added in SwiftVis 0.1.0.