The error is calculated based on the geometric configuration of the GPS satellites present at that time and in that area in the sky.
HDOP
HDOP, Horizontal Dilution Of Precision, calculates the possible GPS error on the 2D plane, i.e. latitude and longitude.