Human perception of sensory stimuli is affected by prior prediction of the sensory experience. For example, perception of weight of an object changes depending on weight predicted with size of the object appearance. We call such psychological phenomena expectation effect. The expectation effect is a key factor to explain a gap between physical variables and their perceptions. In this paper, we propose a novel computational model of human perception involving the expectation effect. We hypothesized that perceived physical variable was estimated using a Bayesian integration of prior prediction and sensory likelihood of a physical variable. We applied efficient coding hypothesis to form a shape of sensory likelihood. We formalized the expectation effect as a function of three factors: expectation error (difference between predicted and actual physical variables), prediction uncertainty (variance of prior distributions), and external noise (variance of noise distributions convolved with likelihood). Using the model, we conducted computer simulations to analyze the behavior of two opposite patterns of expectation effect, that is, assimilation and contrast. The results of the simulation revealed that 1) the pattern of expectation effect shifted from assimilation to contrast as the prediction error increased, 2) uncertainty decreased the extent of the expectation effect, 3) and external noise increased the assimilation.