Linear regression
Case study Galactose diffusion in silica mesopore
Controlled drug release systems
MSD balistic regime caging regime diffusive regime
MSD
T
1. How to check if the molecule is in the diffusive regime? calculate slope of log(MSD) vs. log(t)
2. How to calculate self-diffusion coefficient? calculate slope of MSD vs. T and divide it by 6.
How to analyse data?
Plot!
Plot! Human brain is one the most powerfull computationall tools Works differently than a computer…
Simple example – finding maximum y(x max ) Computer x1x1 x2x2 x3x3
Computer x1x1 1.Set y(x max ) = y(x 1 ). x2x2 x3x3
Simple example – finding maximum y(x max ) Computer x1x1 1.Set y(x max ) = y(x 1 ). 2.Go to the next point x 2 : x2x2 x3x3
Simple example – finding maximum y(x max ) Computer x1x1 1.Set y(x max ) = y(x 1 ). 2.Go to the next point x 2 : 1.If y(x 2 ) > y(x max ) then x max = x 2 2. Else do nothing. x2x2 x3x3
Simple example – finding maximum y(x max ) Computer x1x1 1.Set y(x max ) = y(x 1 ). 2.Go to the next point x 2 : 1.If y(x 2 ) > y(x max ) then x max = x 2 2. Else do nothing. 3. Repeat this procedure until you reach the end. x2x2 x3x3
Simple example – finding maximum y(x max ) Human brain x1x1 x2x2 x3x3
Simple example – finding maximum y(x max ) Human brain x1x1 x2x2 x3x3 Here!
Simple example – finding maximum y(x max ) Human brain x1x1 x2x2 x3x3 Here! With increasing number of points quicker answer
How to analyse data? Plot x against y Observe trend - correlation
How to „measure” linearity? Geometry
How to measure angle between two vectors? Scalar product
How to measure angle between two vectors? Scalar product
How to measure angle between two vectors? Scalar product
How to measure angle between two vectors? Scalar product
How to measure angle between two vectors? Scalar product
Example
Example How to do it?
Example We choose two vectors
Example How to do it? We choose two vectors
Example How to do it? We choose two vectors
Example How to do it? We choose two vectors
Example How to do it? We choose two vectors
Example How to do it? We choose two vectors
What’s the relevance? y1y1 x1x1 x2x2 x3x3 x4x4 y2y2 y3y3 y4y4 X Y Two sets of data Data are vectors!
What’s the relevance? y1y1 x1x1 x2x2 x3x3 x4x4 y2y2 y3y3 y4y4 X Y Two sets of data Linear relationship parallel
How to measure parallelism between two vectors? y1y1 x1x1 x2x2 x3x3 x4x4 y2y2 y3y3 y4y4 Linear relationship parallel = zero angle
How to calculute the angle? Scalar product! y1y1 x1x1 x2x2 x3x3 x4x4 y2y2 y3y3 y4y4 X Y Two sets of data
How to calculute the angle? Scalar product!
Our case y1y1 x1x1 x2x2 x3x3 x4x4 y2y2 y3y3 y4y4 X Y Two sets of data
X Y The best = smallest error What is the best position of the line? Error = data value – estimated value
X Y The best = smallest error What is the best position of the line?
How to adjust a and b so SSE is the smallest? How to calculate minimum of the SSE(a,b) function?
How to adjust a and b so SSE is the smallest?
We obtain a set of linear equations of two variables a and b
Finally… Set of linear equations
How to solve it? Set of linear equations.
Linear regression procedure