I have a matrix with each column represents a feature over time. I need to find the moving average of these values with a given window size.
Is there a function like the one in MATLAB?
output = tsmovavg(vector, 's', lag, dim)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the FILTER function. An example:
or even use the IMFILTER and FSPECIAL from the Image Package
One final option is using indexing (not recommended for very large vector)
Please note the difference in padding:
output1(wndw:end)corresponds tooutput3