# How can Time Series Analysis be done with Categorical Variables

Most of the time series analysis tutorials/textbooks I've read about, be they for univariate or multivariate time series data, usually deal with continuous numerical variables.

I currently have a problem at hand that deals with multivariate time series data, but the fields are all categorical variables. Hence, I was wondering if there is any way to use the standard time series analysis techniques (such as ARIMA, ARMA etc.)

Specifically, my data is a stream of alert data, where at each time stamp, information such as the alert monitoring system, the location of the problem etc. are stored in the alert. These fields are all categorical variables.

By definition time-series ARIMA models assume that, given a numerical observation at time $$t-k$$, the value of the numerical variable $$X$$ at time $$t$$ can be approximated as $$X_t = \sum_{j=1}^p a_j X_{t-j} + \varepsilon_t + c$$ where $$\varepsilon$$ is a white noise error term and the $$a_j$$ are parameters to be determined. The idea is that the numerical variable $$X$$ at time $$t$$ only depends on some of its values at previous times; as you can see, by construction the above works for numerical variables only. Then one introduces some more conditions about moving averages and deviations to be verified and is able to prove that, under such conditions, the form of the coefficients $$a_j$$ can be determined.
The standard way to deal with categorical variables in these cases is to use one-hot encoding, namely you introduce dummy variables for each level of your category and fit against the dummy being 1 or 0, according to whether such category is present or not at time $$t-k$$. A similar question was asked here and you might want to have a look.
You might need to one-hot encode (or label encode) the categorical variables, and then pass them to the model using the add_regressor() method.