Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linear Models Tony Dodd. 21 January 2008Mathematics for Data Modelling: Linear Models Overview Linear models. Parameter estimation. Linear in the parameters.

Similar presentations


Presentation on theme: "Linear Models Tony Dodd. 21 January 2008Mathematics for Data Modelling: Linear Models Overview Linear models. Parameter estimation. Linear in the parameters."— Presentation transcript:

1 Linear Models Tony Dodd

2 21 January 2008Mathematics for Data Modelling: Linear Models Overview Linear models. Parameter estimation. Linear in the parameters. Classification. The nonlinear bits.

3 21 January 2008Mathematics for Data Modelling: Linear Models Linear models Linear model has general form where is the th component of input. Assume and therefore is the bias. Can represent lines and planes. Should ALWAYS try simplest model first!

4 21 January 2008Mathematics for Data Modelling: Linear Models Parameter estimation Least squares estimation. Choose parameters that minimise, SSE Unique minimum… Optimum when noise is Gaussian. Corresponds to maximum-likelihood estimate.

5 21 January 2008Mathematics for Data Modelling: Linear Models Least squares cost function

6 21 January 2008Mathematics for Data Modelling: Linear Models Least squares parameters Define the design matrix Then

7 21 January 2008Mathematics for Data Modelling: Linear Models A bit of maths

8 21 January 2008Mathematics for Data Modelling: Linear Models Example

9 21 January 2008Mathematics for Data Modelling: Linear Models Example

10 21 January 2008Mathematics for Data Modelling: Linear Models Example

11 21 January 2008Mathematics for Data Modelling: Linear Models How can we generalise this? Consider instead Where is a nonlinear function of the inputs. Nonlinear transform of the inputs and then form a linear model.

12 21 January 2008Mathematics for Data Modelling: Linear Models Linear in the parameters A nonlinear model that is often called linear. Can apply simple estimation to the parameters. But… it is nonlinear in the basis functions. Linear in the parameters but nonlinear input-output relationship.

13 21 January 2008Mathematics for Data Modelling: Linear Models Nonlinear mapping (regression)

14 21 January 2008Mathematics for Data Modelling: Linear Models Nonlinear mapping (regression)

15 21 January 2008Mathematics for Data Modelling: Linear Models Nonlinear mapping (regression)

16 21 January 2008Mathematics for Data Modelling: Linear Models Nonlinear mapping (regression)

17 21 January 2008Mathematics for Data Modelling: Linear Models Parameter estimation Define the design matrix Then the optimal parameters given by

18 21 January 2008Mathematics for Data Modelling: Linear Models Example

19 21 January 2008Mathematics for Data Modelling: Linear Models Example

20 21 January 2008Mathematics for Data Modelling: Linear Models Example

21 21 January 2008Mathematics for Data Modelling: Linear Models Example – how does it work?

22 21 January 2008Mathematics for Data Modelling: Linear Models Example – how does it work?

23 21 January 2008Mathematics for Data Modelling: Linear Models Example – how does it work? Add all these together To get the function estimate

24 21 January 2008Mathematics for Data Modelling: Linear Models Example – when it all goes wrong

25 21 January 2008Mathematics for Data Modelling: Linear Models Linear classification How do we apply linear models to classification – output is now categorical? Discriminant analysis. Probit analysis. Log-linear regression. Logistic regression. Aim is to get a linear decision boundary.

26 21 January 2008Mathematics for Data Modelling: Linear Models Logistic regression A regression model for Bernoulli-distributed targets. Form the linear model where

27 21 January 2008Mathematics for Data Modelling: Linear Models Can we generalise it? Instead of use a linear in the parameters model

28 21 January 2008Mathematics for Data Modelling: Linear Models Nonlinear mapping (classification)

29 21 January 2008Mathematics for Data Modelling: Linear Models Nonlinear mapping (classification)

30 21 January 2008Mathematics for Data Modelling: Linear Models Nonlinear mapping (classification)

31 21 January 2008Mathematics for Data Modelling: Linear Models Nonlinear mapping (classification)

32 21 January 2008Mathematics for Data Modelling: Linear Models Parameter estimation Maximum likelihood. Maximise the probability of getting the observed results given the parameters. Although unique minimum need to use iterative techniques (no closed form solution).

33 21 January 2008Mathematics for Data Modelling: Linear Models Example

34 21 January 2008Mathematics for Data Modelling: Linear Models Example

35 21 January 2008Mathematics for Data Modelling: Linear Models Example

36 21 January 2008Mathematics for Data Modelling: Linear Models Example

37 21 January 2008Mathematics for Data Modelling: Linear Models Example – class probabilities

38 21 January 2008Mathematics for Data Modelling: Linear Models But…

39 21 January 2008Mathematics for Data Modelling: Linear Models Basis function optimisation Need to estimate: Type of basis functions. Number of basis functions. Positions of basis functions. These are nonlinear problems – difficult!

40 21 January 2008Mathematics for Data Modelling: Linear Models Types of basis functions Usually choose a favourite! Examples include: Polynomials: Gaussians: Fourier: …

41 21 January 2008Mathematics for Data Modelling: Linear Models Number of basis functions How many basis functions? Slowly increase number until overfit data. Exploratory vs optimal.

42 21 January 2008Mathematics for Data Modelling: Linear Models Positions of basis functions This is really difficult! One easy possibility is to put one basis function on each data point. Uniform grid (but curse of dimensionality). Advantage of global basis functions e.g. polynomials – don’t need to optimise positions.

43 21 January 2008Mathematics for Data Modelling: Linear Models Note on Data How much data do we need? Enough to train the model? But how much is this? What about validating and testing the model? Need train, validate and test data!

44 21 January 2008Mathematics for Data Modelling: Linear Models Concluding remarks Always try the simplest possible model first (e.g. linear). Can make nonlinear in the input but linear in the parameters. But becomes nonlinear optimisation. Is least squares/maximum likelihood the best way?


Download ppt "Linear Models Tony Dodd. 21 January 2008Mathematics for Data Modelling: Linear Models Overview Linear models. Parameter estimation. Linear in the parameters."

Similar presentations


Ads by Google