get_Sliding_Indexes​(numRecords, windowLag, predHorizon, windowPattern, stepSize)

Generates sliding window indexes for auto regression on a univariate time series
50 Downloads
Updated 16 Aug 2016

View License

Useful for autoregression on a univariate time series.
Returns the indexes for the predictor and response variables according to a sliding window.
Parameters:
numRecords - the number of records in the dataset

windowLag - number of past samples to take - it will be equal to
the size of the predictor vector X. Default 10

predHorizon - the prediction horizon is the number of steps into
the future that predictions are to be made. Default 1

windowPattern - by default the window will take all consecutive
values in the past over the window lag size, however it is
possible to sample using a custom pattern.
For example taking every second value can be done by setting
this parameter to 1:2:5. Default 1:windowLag

stepSize - number of steps taken when window is moved. Default 1

Returns:
indX - predictor variable indexes
indY - response variable indexes

Cite As

Florin Schimbinschi (2024). get_Sliding_Indexes(numRecords, windowLag, predHorizon, windowPattern, stepSize) (https://www.mathworks.com/matlabcentral/fileexchange/58730-get_sliding_indexes-numrecords-windowlag-predhorizon-windowpattern-stepsize), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.1.0

Changed description

1.0.0.0