# How to test the linearity assumption of a model?

Let's say I want to have a model that projects income over a stressed period. I have a marked-to-market component that shows the P&L of trading book positions during this stressed period. Along with that, I have Gross Revenue data, Expenses, Carry, Transfer Pricing, Treasury Costs, etc, such that: MTM P&L + Forecasted Revenue + Forecasted Carry + Forecasted Transfer Pricing + Forecasted Treasury Costs - Expenses = Income

I want to check whether this linear assumption holds; that Income is simply additive across the variables mentioned. How could I test this?

• It is unclear what you are asking. Are you asking if there is a way to test an accounting identity, or are you asking whether, under shock, the responses of the underlying variables will be linear? – Dave Harris Jan 31 at 6:05

To test the linearity of a model, you look at the residuals obtained from the regression. For example, check out this code snippet from R:

# Import a library that contains data:
library(car)

# Fit a multiple regression on this data:
# (We are trying to predict miles per galon from some car variables)
fit <- lm(mpg~disp+hp+wt+drat, data=mtcars)

# Evaluate Nonlinearity
# component + residual plot
crPlots(fit)

# Notice that the relationship is nonlinear with respect to the variable 'disp', for example.


You could also have used, instead of crPlots, the function ceresPlots, which is slightly different, but serves the same purpose of checking for non-linearities:

# Ceres plots
ceresPlots(fit)


Do you have multiple observations of this relation? If so then you could perform linear regression and perform all the regression diagnostics.

You would perform a multiple regression, except that instead of using the standard default of $$\beta=0$$, for all of your $$\beta$$s, instead, you would use $$\beta=1$$ for all $$\beta$$s. If the F test is statistically significant, then your null hypothesis is falsified. Depending upon the computer language, it will require a manual intervention into the code.

It sounds like you are asking about the adequacy of a linear model fit to data on these variables. In this context, you need to suggest the functional form of an alternative to test it against. A model including linear as well as (at least some) squares and cross-products of your variables seems a standard alternative, and can sometimes be rationalized as an approximation (Taylor) of a more generic differentiable functional form. In short, you're going to compare the fit of your linear model to one including these other terms in a regression context.