Stability analysis of switched ARX models and application to learning with guarantees. (November 2022)