Simple Binary Series prediction

4 visualizaciones (últimos 30 días)
Fabio Galicia
Fabio Galicia el 22 de Jul. de 2016
Respondida: Jaynik el 20 de Jul. de 2024
I am trying to extract single binary patterns to be able to predict the next estate. The data normally renders simple patterns, for instance:
1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0
I am using a LS-Support Vector Machine for more complex problems, but I guess there is a simpler and more elegant way to predict a simple binary series like this one? I am quite new to Matlab. Thanks!

Respuestas (1)

Jaynik
Jaynik el 20 de Jul. de 2024
Hi,
One method for simple binary series is using Autoregressive Integrated Moving Average (ARIMA) models, which are often used in time-series prediction.
Following is a simple example of how you might use an ARIMA model to predict the next state of your binary series:
data = [1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0];
Mdl = arima(2,0,0); % Fit the ARIMA model
EstMdl = estimate(Mdl, data');
[yF,yMSE] = forecast(EstMdl, 1, 'Y0', data'); % Predicting the next state
next_state = round(yF);
In this example, arima(2,0,0) creates an ARIMA model object representing the AR(2) model, i.e., a 2nd order autoregressive model. The estimate function fits the model to your data, and the forecast function predicts the next state based on the fitted model. The round function is used to convert the predicted value to the nearest integer (0 or 1).
Refer to the following documentation to read more about each function:
Please note that the example code is very basic and might not work perfectly for your data. You might need to adjust the parameters of the model or preprocess your data to get better results. Also, ARIMA models assume that the data is stationary, which might not be the case for binary series. If the data is not stationary, we might need to use differencing or other methods to make it stationary before fitting the model.
Hope this helps!

Categorías

Más información sobre Conditional Mean Models en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by