# How can I estimate autoregression when non-stationary?

I have a series that I believe has one autoregression characteristic under condition A (example: positive) and another under condition B (example: negative).

Is there a way (hopefully in Python) to estimate the parameters if I know when in condition A and when condition B? What if I don't know and I want to find both the best parameters and when each condition occurs?