Volume is a parameter which is usually passed in a MIDI message to
describe a musical note. This parameter is determined by measuring
the energy of a string at one point. The total energy of a string
is a function of both time and location on the string
Kinetic energy = 1/2 mass * (particle velocity)^2.
The second term is a function of time and location as mentioned.
The guitar uses a magnetic pick-up which indicates string velocity
at a point. Since the displacement of the string is only known at
one point and a number of initial conditions need to be known to
determine the velocity of the string at all points along the entire
string, the magnetic signal squared is used to represent energy
(volume) of the signal.
The following graph represents the positive part of the test signal,
which is an actual guitar signal, and two curves labelled volume1
and volume2.

Volume1 is the guitar signal squared and averaged over a time period
to smooth the results. When the signal is not available (noise only),
a short window of six samples (shortest pitch possible) is used to
average the volume measurement. When a valid signal occurs, the volume
measurement is averaged over one period of time or the amount of pitch
measured.
Volume2 is the absolute value of the guitar signal averaged over the
time periods mentioned.
The STATE description page describes how the time periods are obtained
to make the volume calculations.
Conclusions:
Volume1 follows the shape of the guitar signal better than volume2.
The guitar signal is a direct indication of the relative measure
of the energy of the string.