A physical model for the variability properties of X-ray binaries