ios – How does HealthKit calculate the variables activeEnergyBurned and others?

I'm investigating the use of HealthKit to provide data to an application that will run on iOS. We are thinking of using Apple Watch to collect data. I am particularly interested in activeEnergyBurned and some associated quantities, namely basalEnergyBurned, respirRate and Vo2Max.

It seems that the sensors of the Apple Watch are only the orientation, the acceleration and the heart rate. I assume that the activeEnergyBurned component, etc., must be calculated from these elements. Can any one provide documentation or other information on how these items are calculated? In particular, it would be very useful to know all known limitations or constraints.

I was unable to locate any information about this with a web search. The only information that I found related is the following question: How to make Apple Watch 2 calculate VO2 Max data? I've also found this: https://discussions.apple.com/thread/8082402

Are there better articles or descriptions than those mentioned above to learn how active energy is calculated?