fit_cumhist function

Fits cumulative history for bistable perceptual rivalry displays.