In this paper the interest is in regression analysis for data that show possibly overdispersion or underdispersion. The starting point for modeling are generalized linear models in which we no longer admit a linear form for the mean regression function, but allow it to be any smooth function of the covariate(s). In view of analyzing overdispersed or underdispersed data, we additionally bring in an unknown dispersion function. The mean regression function and the dispersion function are then estimated using P-splines with difference type of penalty to prevent from overfitting.
We discuss two approaches: one based on an extended quasi-likelihood idea and one based on a pseudo-likelihood approach. The choices of smoothing parameters and implementation issues are discussed. The performance of the estimation method is investigated via simulations and its use is illustrated on several data, including continuous data, counts and proportions.