  We consider Markov-switching regression models, i.e. models for time series
regression analyses where the functional relationship between covariates and
response is subject to regime switching controlled by an unobservable Markov
chain. Building on the powerful hidden Markov model machinery and the methods
for penalized B-splines routinely used in regression analyses, we develop a
framework for nonparametrically estimating the functional form of the effect of
the covariates in such a regression model, assuming an additive structure of
the predictor. The resulting class of Markov-switching generalized additive
models is immensely flexible, and contains as special cases the common
parametric Markov-switching regression models and also generalized additive and
generalized linear models. The feasibility of the suggested maximum penalized
likelihood approach is demonstrated by simulation and further illustrated by
modelling how energy price in Spain depends on the Euro/Dollar exchange rate.
