Addresses the problem of identification of hybrid dynamical systems, by focusing the attention on hinging hyperplanes and Wiener piecewise affine autoregressive exogenous models. In particular, we provide algorithms based on mixed-integer linear or quadratic programming which are guaranteed to converge to a global optimum.