On a real Monge—Ampère functional