The invention provides a method for a method for determining a best initial focal
position estimate for a current sample location on a substrate comprising multiple
sample locations, comprising determining the best initial focal position estimate
by using a result from one or more techniques selected from the group consisting
of linear regression analysis of focal positions determined for at least two other
sample locations on the substrate and quadratic regression analysis of focal positions
determined for at least three other sample locations on the substrate.