File Exchange

## Mackey Glass Time Series Prediction Using Least Mean Square (LMS)

version 2.0.0.0 (102 KB) by Shujaat Khan

### Shujaat Khan (view profile)

Mackey Glass Time Series Prediction Using Least Mean Square (LMS)

Updated 15 Jan 2018

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

tu

Shujaat Khan

### Shujaat Khan (view profile)

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

### Mark (view profile)

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

### Shujaat Khan (view profile)

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

### Shujaat Khan (view profile)

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

### Mark (view profile)

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

Mark

### Mark (view profile)

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

### Shujaat Khan (view profile)

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

### Mark (view profile)

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

Excellent work though