the most important thing is to match the current with respect to voltages.

Here I show you the current with expected VDS, the dots are measurements.

The broken line is a model, and it appears that it matches pretty well.

Now as model parameter values are varied in order to minimize the error,

we need to have something specific that we call Error.

So you can take the difference between the model prediction for

the jth point here, so j ranges from one to k.

Take any one of these points, take the predicted value and caluclate the error

from the actual measurement of that point normalized by that value.

And then square this so that if this area is sometimes positive for

a certain point and negative for another point.

The two errors don't cancel each other.

And add up all of the relative errors possibly weighting them

with weighting factors, so you can pay special attention to certain regions.

For example if you're interested in having very good accuracy

in the saturation region.

WIDJ for points in this saturation region might be chosen larger

than the corresponding weighting factors over here in the non-saturation region.

Then you add up all this and you end up with a total square area,

counting all of these points.

Now if you divide by the number of points, K in this case,

then you end up with a mean square error.

And if you take the square root of that you end up with the root mean square error

or RMS error.

So you can use the RMS error to adjust the model.

And you can give this criterion to your optimizer and

ask it to choose parameter values so as to minimize the RMS error.

So let's say we've done it, and we've jotted in the parameters and

the model is as shown by the broken line, it looks pretty good.

However but think of the following, let's say you are in the saturation region, and

the saturation region the slope is the so called small signal output conductance,

which is of key importance in analog design.

Now although you matched the current pretty well,

it doesn't mean you matched the slope very well.

In fact you may see already that the broken line has a smaller slope

than what could correspond to the measured points.

So now if you plot the slope both for the measured points and for

the model, you may end up with something like this.

This is the slope that corresponds to the measurements,

assuming you have plenty of points to calculate the slope from.

And this is the slope that corresponds to the model.

How can they be so different?

Well because the slope is so small here, let's say Epsilon,

it's Epsilon for the Measurements and Epsilon over two for the model.

They're both very small and you cannot see the difference here but

once you plot the slope things become very apparent that this excellent looking model

is actually pretty bad in predicting the output conductance.

So if you calculate the error of the output conductance you do the same

thing as we did for the current.