get_Sliding_Indexes(numRecords, windowLag, predHorizon, windowPattern, stepSize)
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
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.