Simple Binary Series prediction

3 次查看(过去 30 天)
Fabio Galicia
Fabio Galicia 2016-7-22
回答: Jaynik 2024-7-20,10:27
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!

回答(1 个)

Jaynik
Jaynik 2024-7-20,10:27
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!

类别

Help CenterFile Exchange 中查找有关 Conditional Mean Models 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by