- Have a look at the following set of values:
x 1 2 3 4 y 1 3 5
- What would be the value of y when x is 4?
- Did you guess 7?
- That is because in your mind you have spotted a relationship between x and y, that when x increases by 1, y increases by 2.
- More formally, the relationship between x and y is:
- This is a mathematical model. It describes the relationship between inputs and outputs.
- x is an input.
- y is an output.
- We can use the model to make predictions for future inputs, such as x = 4.
Linear vs non-linear models
- The above model is called a linear model. This is a model that uses a straight line to represent it's relationship between the input and output:
- If you plot the values on a graph, you could connect them with a straight line.
- m and b are called the parameters of the model.
- Non Linear
- A model which isn't a straight line is called non-linear.
- For example:
- You are trying to predict how many handshakes there will be at a meeting.
- Assuming that everyone shakes everyone elses hand once, the data will be:
number of people 2 3 4 5 number of handshakes 1 3 6 10
- If we plot this on a graph, we see it's not a straight line:
- The equation for this would be:
- Which is of the form: where a, b and c are parameters set to 0.5, -0.5 and 0 respectively.