The compass has nothing to do with altitude; it is for heading only.
The bird gets altitude readings from GPS and the NAZA altimeter.
The thing to remember is that GPS, while great for position, is seriously weak in the altitude category.
An altimeter is more accurate, but you must know the barometric pressure at the particular time and location,
and it must be compensated for in the altitude calc, which cannot be done in the existing hardware.
Aircraft pilots are constantly advised of the local "altimeter" settings by A.T.C. for that very reason. ("two niner, niner two", etc.)
If you have a large storm approaching, and the B.P. drops, you will get a different altitude reading sitting in the same spot.
The bird uses the altimeter in a relative way to hover; it just tries to keep the reading steady.
It is not accurate for an absolute altitude reading.