Lec 56: Empirical Modelling

IIT Roorkee July 201
61 followers
Aug 16, 2024
This lecture explores empirical modelling, including its definition and key algorithms. We'll discuss how empirical models are developed and used in various applications.
[Music]
[Music]
hello welcome to the course excelling
with mathematical modeling to today we
will be talking about empirical
models now let's see what do you mean by
empirical
model so generally the trend is that
when you construct a model you have some
data and you use some mathematical tools
to formulate the model and then with the
help of the data you try to estimate the
parameters that is inside the model that
is the general Trend so we used
the theory of one form of another which
is any mathematical tool to construct
the model and then we use data if it is
available to determine the value of the
parameters that is inside the model and
this is called Model fitting and the
resulting model will be called the
analytical models so as you will be
noticing that the data which we try to
fit it's not an exact fit but an
approximate fit but but we are ready to
deal with it and some and most of the
cases it gives some reasonable
predictions
now sometimes we don't use those
mathematical tools but only rely on data
that is we build the model solely Guided
by the data it depends what kind of
situation you're in so sometimes you
need a trend so for example say in
covid-19 so daily there is a spike or
daily there is some Dynamics going on
whether it is rising or whether it is
falling so I need daily Trend so I need
the carve what is happening like this so
you have a lot of data so with the help
of this trend or this data you try to
build a model so that you can
predict the next Trend so that kind of
model we call it as
empirical models that is you have only
the data you don't use any mathematical
tools you use some software to
understand this trend and once you
understand the trend you can then
predict what will be the rest of the
values yes of course while capturing the
trend you have to use certain
mathematical formula that is there but
the total thing is that totally Based on
data
so that is what we call empirical
models so I will give you a
start of how this is done so if it
something
say logarithmic
model the equation will look in the
form a + b Ln
X then we have power
model which will have a x to the power B
then we have exponential
model which is y = a e to the power BX
here all a BS are
constants they can be positive they can
be
negative also there is a linear
model which is y = a + BX there can be a
polinomial
model which can be y = to a + b x + C x²
a specific one this is a parabolic one
so the question is which of them to use
though I said that okay you buil up the
model with the help of the data you find
the trend but that that train follows
certain equations and those equations
you have to choose so for example if
I plot the
graphs say I
have this
equation so this is y = e^ x this value
is one this is y = to Ln X
then I can
have a linear one y = to
X I can have a parabolic one y =
x² then I can
have power graph y = x the^
0.5 so all of them coincides at this
point should be one one but anyway so
the idea is that how to choose the
equations like this so if you have the
data and the data follows something like
in this particular
pattern then you know okay I have to
choose an exponential one if it follows
a pattern like this you know it have to
choose a logarithmic one and similarly
for
the linear or polinomial or the power
model so how this will work so what you
will have is that you will have
the X values and the Y values say this
is X1 X2
X3 y1 Y2 Y3 so this is the set of data
which you will
get so once you get the
data you plot the
data like this
and then you choose any of the trend so
once you choose the
trend then you will get a curve or a
straight line like
this so you get this trend you find the
equation of this trend and
you calculate these values y1
Y2 Y3 and so on and then there is
something called
residuals so the residuals means the
difference of the data which is given
and The observed and the value which you
have calculated you take the difference
of y1 minus y1
Dash then you plot so this is the
difference between the actual data and
the one which has been predicted by
certain software in this case it will be
Microsoft
Excel so then you plot them here is the
X values and here will be the
residuals so along the axis y equal to Z
these residuals will be there some of
them will be positive some of them will
be
negative generally if it is half of them
in the positive direction and half of
them in the negative Direction and the
rest is very close to y equal to 0 it
can be up it can be down we say okay
that this is a good fit the residuals
should not show any Trend by Trend I
mean say it can be say like this or it
can be say like this so if they follow
certain Trend then this is not a very
good fit then you change the model and
you move on so that is how it is going
to
work let's now look into the numerical
or
the Excel version that how we will use
Excel to to empirically create a model
so you will be given a data something
like this these are the X values and
these are the Y values so the x value
says that in certain countries these are
all countries different countries and so
number of persons the phys number of
Physicians available so 245 only one
Physicians like that and the life
expectancy is this much
years so let's first see the trend so
you highlight these
datas you go to
insert you select the scattered diagram
or the chart and plot
it like
this so I will not use the grid
lines and let me try to fit
say logarithmic
model so I
put
empirical
model so next is I highlight
this and I have to fit a trend which is
already inbuilt in Excel you click this
plus and you see this trend line so you
click this Arrow
and so many opens go to more
option and you will see that there is
exponential linear
Ric logarithmic polinomial power moving
average everything is there so say I
choose the logarithmic one I click this
and you can see that the trend line
changes and if you go a little below you
will see display equation on the chart
so the line which has been chosen is
logarithmic which is of the form y = a +
b Ln X but I don't know the value of a
and b but this particular display
equation will actually give you the
equation so if I click this I get the
equation so I have
this I take it here you can see the
equation let make it a bit
bigger say
16 yeah now I can
see so I have these data I am trying to
fit logarithmic model and I got the
equation to be like
this so let me first calculate these
values that this is equal to so this is
the data which is given and this value
will I will get from from here so this
is equal to
minus
5288 multiplied
by
Ln X so X is this
value bracket
close
plus
103.4 and I get this value
I calculate
this and then comes
the
residuals so the residuals will be the
data the difference between the data and
the one which you got from the trend
line so this is the
difference and you drag and calculate
the value so next what we will do is
that we will we plot the X
values and the
residuals then you go to
insert go to this
chart and get the
points so let's make this a bit
smaller so that both the charts can fit
so I just name it
as
logarithmic
model
and
residuals so as I was telling that how
will you know that this is a good fit so
you will know it from here that if you
see the number of points in the top of y
equal to0 so y equal to0 is this
straight line This is the xaxis whose
equation is y equal to
Z so you can see that 1 2 3 4 four
points and here also 1 2 3 4 so Four
Points up four points down and the rest
four though they are on the above y
equal to 0 but they are very close to y
to0 so and in fact one of them almost
touches y equal to0 so that's
why these two variations are very very
less and hence we say that this
empirical model which is following this
logarithmic model is a good fit or is a
good model and also the residuals
doesn't follow any Trend so by Trend I
mean that you will see in an example
that it is f a certain way of a of a
curve so we say but here it looks like
they're random so if you get something
like this where half of it on one side
of y equal to Z and the other half is on
the other side and then the rest of the
points are very close to y equal to0 we
know that okay this is a good empirical
model let's try to Feit another model a
power model to the same set of data and
let's see what we
get so we have a power model so as I
told you these are the countries these
are the persons change the
vars and this is the life
expectancy so as usual first
we plot this we go to insert we go to
charts and Scatter
diagram so I name it empirical model
oops
so
insert so I change the chart
title
empirical
model and then I try to fit the
trend go to the this I remove the grd
lines I go to this trend
line and I will choose power so I go to
more option and here is the power so the
moment I click this you can see that
there's a change here and I want the
equation so
display this
so we'll take this
equation somewhere
here and increase the font
size so that you can see so this is the
equation of the power model which is of
the form y = to a x to the power B so
the value of a is
11763 and B is min - 0.082
I reduce this a bit and then I calculate
this is equal to
117
63 multiplied
by
x to the
power
minus
0.082 okay and I get this values
I calculate
them then I calculate
residuals so the residuals is going to
be the difference between the
data and the train
equation get this value
you drag it so please note this is the
difference so this minus this or this
minus this really doesn't matter there's
only the change of signs so the next
thing is you plot the
X and the
residuals as a scatter diagram
so power
modal re see
du so this is the line Y =
to0 here and and you can see this is 1 2
3 4 again 1 2 3 4 so four on the one
side of y equal to Z four on the other
side here also this is five this is also
five and these two are quite so I can
take this one as five and this one has
another five and this and this are very
close to y equal to0 so again this is is
a good empirical model so with this set
of data both the logarithmic Trend as
well as the power model Trend they both
fits well and you can follow any one of
them let's go to the another
one
so here let's try another more another
empiric model say exponential model so I
go to this go to insert I
scatter and I get this
model this
is
model go to this I don't like grid lines
go to trend line click this
and
exponential I can go to more options and
I
click exponential though it looks like a
straight line the moment we click the
equation display equation it will be
clear that it is an
exponential
model and not straight line
one so and I change it to 6
so now you have a look that this is the
model so if I want to plot this this is
equal
to
70537 multiplied
by E
XP Min - 0
1
2 3 4
3 multiplied by
X then I calculate the residuals
okay so now we calculate the
residuals which is this data value minus
the value which you got from the trend
equation you calculate the
residuals and then you
plot the
X and the residuals
and you get
the exponential model residual
chart let me now go back to the slides
and
quickly explain the
trains so let's quickly comparison the
residuals which we already calculated in
our spreadsheet so as explained that in
the logarithmic model you can see that 1
2 3 4 and 1 2 3 4 so this is the line y
equal
to0 so four of them lies below y equal
to Z four of them lies
above and these two are very very close
to the line y equal to Z so if we get
such a thing we say that the empirical
model is good the power model also gives
a similar kind of thing that you have 1
2 3 4 and again 1 2 3 4 this is is the
line Y = to0 and we have this two and
these two are quite close to yal 0 and
we say that your power model also
behaves well so either you can use the
logarithmic model or you can use the
power power model for this now if you
look into the so if you look at the
exponential model in this case you can
see though six of them lies in the top
and we have six of them Li at the bottom
of y equal to 0 but their difference is
quite high so the conclusion is that the
logarithmic model and the power model
they are better empirical models in this
case than the exponential model so with
this we come to an end of this lecture
where you get a rough idea that how to
create an empirical model from the data
in my my next lecture we will going
through the estimation of parameters
which is again one of the very important
aspect in mathematical modeling till
then bye-bye
[Music]
a
[Music]
