  In this paper, we study the power control problem for Over-the-air
computation (AirComp) over fading channels. Our objective is to minimize the
computation error by jointly optimizing the transmit power at the
power-constrained devices and a signal scaling factor (called denoising factor)
at the fusion center (FC). The problem is generally non-convex due to the
coupling of the transmit power over devices and denoising factor at the FC. To
tackle the challenge, we first consider the special case with static channels,
for which we derive the optimal solution in closed form. The optimal power
control exhibits a threshold-based structure. Specifically, for each device, if
the product of the channel quality and power budget, called quality indicator,
exceeds an optimized threshold, this device applies channel-inversion power
control; otherwise, it performs full power transmission. Building on the
results, we proceed to consider the general case with time-varying channels. To
solve the more challenging non-convex power control problem, we use the
Lagrange-duality method via exploiting its "time-sharing" property. The derived
optimal power control exhibits a regularized channel inversion structure, where
the regularization has the function of balancing the tradeoff between the
signal-magnitude alignment and noise suppression. Moreover, for the special
case with only one device being power limited, we show that the optimal power
control for the power-limited device has an interesting channel-inversion
water-filling structure, while those for other devices (with sufficient power
budgets) reduce to channel-inversion power control over all fading states.
