We have developed an independent algorithm for the prediction of electronic portal imaging device (EPID) response. The algorithm uses a set of images [open beam, closed multileaf collimator (MLC), various fence and modified sweeping gap patterns] to separately characterize the primary and head-scatter contributions to EPID response. It also characterizes the relevant dosimetric properties of the MLC: Transmission, dosimetric gap, MLC scatter [P. Zygmansky et al., J. Appl. Clin. Med. Phys. 8(4) (2007)], inter-leaf leakage, and tongue and groove [F. Lorenz et al., Phys. Med. Biol. 52, 5985-5999 (2007)]. The primary radiation is modeled with a single Gaussian distribution defined at the target position, while the head-scatter radiation is modeled with a triple Gaussian distribution defined downstream of the target. The distances between the target and the head-scatter source, jaws, and MLC are model parameters. The scatter associated with the EPID is implicit in the model. Open beam images are predicted to within 1% of the maximum value across the image. Other MLC test patterns and intensity-modulated radiation therapy fluences are predicted to within 1.5% of the maximum value. The presented method was applied to the Varian aS500 EPID but is designed to work with any planar detector with sufficient spatial resolution.