Generalized linear models

One of the core ideas of this chapter is rather simple: in order to predict the mean of an output variable, we can apply an arbitrary function to a linear combination of input variable.

Where is a function, we will call inverse link function. There are many inverse link functions we can choose; probably the simplest one is the identity function. This is a function that returns the same value used as its argument. All models from Chapter 3, Modeling with Linear Regression used the identity function, and for simplicity we just omit it.  The identity function may not be very useful on its own, but it allows us to think of several different models in a more unified way.

Why do we call f, the inverse link function, instead of just the link function? Because traditionally people apply functions to the other side of equation 4.1, and unfortunately for us, they already called dibs on the term link function—so to avoid confusion, we are going to stick to the term inverse link function.

One situation under which we would like to use an inverse link function is when working with categorical variables, such as color names, gender, biological species, or political party/affiliation. None of these variable is well-modeled by Gaussians. Think about it, in principle, a Gaussian works well for a continuous variable taking any value on the real line, while the variables mentioned here are discrete and only take a few values (such as red, green, or blue). If we change the distribution we used to model the data, we will in general need to also change how we model the plausible values for the mean of those distributions.  For example, if we use a binomial distribution, like in Chapter 1Thinking Probabilistically and Chapter 2Programming Probabilistically, we will need a linear model that returns a mean value in the [0, 1] interval; one way to achieve this is to keep the linear model but use an inverse link function to restrict the output to the desired interval. This trick is not restricted to discrete variables; we may want to model data that can only take positive values, and thus we may want to restrict the linear model to return positive values for the mean of a distribution, such as Gamma or exponential.

Just before moving on, note that some variables can be codified as quantitative or as qualitative, and that this is a decision you have to make based on the context of your problem; for example, we can talk about the red and green categorical variables if we are talking about color names, or we can talk about the 650 nm and 510 nm continuous variables if we are working with wavelengths.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.182.66