## Section 7: Looking at the data in the other direction—making an inverse model

Often it is obvious which of the variables from the data set you want to be predicted by the model you intend to fit to the data. But sometimes either choice makes sense, depending on what you are doing.

In the case of the sediment-depth data we started with the model that is appropriate if you want to predict the sediment depth at a specified time after cleaning. This model uses days as input and depth as output. But an inspector might decide to measure the sediment depth in order to estimate how long it has been since the last cleaning. He would need a model that uses depth as input and produces days as output. This can be produced in exactly the same way as before, but the two columns of data switch their roles.

Example 10: Describe the model to estimate days since cleaning from measurements of sediment depth.

Answer: Make a new copy of the spreadsheet with the data and the linear function settings, then:

1. Swap column A and column B, including the titles at the top, but still label A2 “x” and B2 “y”.

2. Find good settings for the intercept and slope by the methods discussed earlier in this topic.

3. An example of a good model for this reversed data is $y=0.56x-6.7$.

This fitted model is the inverse of the $y=1.8x+11$ model fitted earlier that used days as input and depth as output. This is clearer if names are used in the formulas rather than x and y:

\begin{align}&\text{depth}=1.8\tfrac{\text{mm}}{\text{day}}\times\text{days}+11\text{mm(original model)}\\&\text{days}=0.56\tfrac{\text{days}}{\text{mm}}\times\text{depth}-6.7\text{days(inverse model)}\\\end{align}

In fact, we could have derived the inverse model from the original model by using algebra instead of model construction and have gotten almost the same answers (they might differ slightly because noise in the input data affects the fitting process somewhat differently than the same noise in the output data).