## Alternative Specification Best Fit Polynomials

An alternative to the classic gravity model is a polynomial equation. Such an equation allows for the use of different factors and powers of those factors. Using such equations, one can often find a specification that offers the best fit for the data among a number of alternatives, including the gravity model.

### Software Advances

After the sales data are plotted by distanceâ€”done during the exploratory data analysis or while examining a gravity model specificationâ€”recent versions of MATLAB make fitting polynomial equations of multiple degrees relatively simple, at least with equations involving only two variables.

Once the data are plotted in MATLAB, a figure window appears showing the analysis.350 Within the Tools menu of this window, select Basic Fitting to open the basic fitting tool window. Using this tool, you can fit equations of different polynomials to the data very quickly

Example: Quadratic Equation

For example, if you select the quadratic equation box, MATLAB will fit an equation in the form

to the data; if you select the cubic equation box, MATLAB will fit an equation in the form y=P1xx?+p2xx^+p3xx+p4

to the data (where p1, p2, p3, and p4 are constant numbers estimated by the toolbox, y is the sales variable, and x is the distance variable). If you use MATLAB to determine the best-fit equations for linear, quadratic, cubic, fourth degree, and possibly other degree polynomials, you can determine the equation that best estimates the actual sales based on distance data. To do this, return to your original data source and compare sales figures projected for each distance by the best-fit polynomials to the actual sales figures at those distances.

350 As with other references to specific software features, these instructions may vary from version to version. In particular, the curve-fitting features within the figure window were not available in versions before R13. If you are using an older version or a different software package, you will need to directly specify and estimate the polynomial model. Other mathematical and statistical software are capable of similar procedures.

## Post a comment