Looking at NMEA Revealed,
We have for description of the field altitude:
Antenna Altitude above/below mean-sea-level (geoid) (in meters)
And for description of the field geoidal separation:
Geoidal separation, the difference between the WGS-84 earth ellipsoid and mean-sea-level (geoid), "-" means mean-sea-level below ellipsoid
Let's note (as in answer by @mkennedy):
h = height above ellipsoid
H = elevation, orthometric height (i.e. antenna altitude in GPGGA)
N = geoidal separation (some books call this the geoidal height)
And consider N to be negative. Then according to catdb.org, the mean-see-level is below elipsoidellipsoid ("-"), so H > h
(H is height from mean see level, h is height from ellipsoid). So H = h + DH = h + D
with D positive. As N is negative we must take D = - N.
So the correct formula is:
h = N + H