File Exchange

## Mackey Glass Time Series Prediction Using Least Mean Square

version 2.0.1 (105 KB) by
Mackey Glass Time Series Prediction Using Least Mean Square (LMS)

Updated 16 Apr 2020

View Version History

In this submission, I demonstrated the problem of time series prediction using least mean square (LMS) algorithm.

### Cite As

Shujaat Khan (2020). Mackey Glass Time Series Prediction Using Least Mean Square (https://www.mathworks.com/matlabcentral/fileexchange/61017-mackey-glass-time-series-prediction-using-least-mean-square), MATLAB Central File Exchange. Retrieved .

### Comments and Ratings (9)

tu

Shujaat Khan

Hello Mark,
Now, I uploaded a new code for you. The code is quite similar to this code but it utilize the output generated by the filter itself (you can say a feedback) to predict next outcome. In this way you can generate data for N future values.

https://www.mathworks.com/matlabcentral/fileexchange/61174-extrapolation-of-a-sinusoidal-signal-using-least-mean-square--lms-

Mark

Ah! Now I understand. Brilliant work.

If I can give a suggestion for the next update, incorporating the "few modifications" so the code can extrapolation beyond the end of data (i.e. past 3000) would be helpful.

Thanks again

Shujaat Khan

There was some mistakes in previous version. In this update I made following changes.

- correction of weight update rule.
- correction of error calculation

Shujaat Khan

In time series prediction we feed some initial values or past data to predict the future outcome. This is closely related to extrapolation. In this implementation you can only predict the first next outcome, that is to say, if you provide values for t={-M,-M+1,-M+2, ... , 0}, then you can predict the value at time t=1.

With few modifications you can change this code to predict other future values as well.

Mark

To be clear, can I modify the code to extrapolate the data to an x-value of say 3300?

Mark

I'm not sure if I understand the purpose of this algorithm

Does this algorithm extrapolate over the range of Ts (the testing data)?

If yes, why are Xs fed into the "prediction of the next outcome of the series using previous samples?

If not, what is the testing data in the context of this algorithm

Sorry, I'm new to LMS.

Thank you very much

Shujaat Khan

Thank you Mark for your positive comments.

Selection of etaf, and f is not in the part of this submission. I will try to put the explanation in the relevant submission.

Mark

A procedure for picking eta, etaf, f and M would be helpful.

Excellent work though

##### MATLAB Release Compatibility
Created with R2011a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux
##### Acknowledgements

Inspired by: Mackey-Glass time series generator

### Community Treasure Hunt

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

Start Hunting!