<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Dear Rcpp-devel list,<div><br></div><div>Wasn’t sure if this got sent last time as I didn’t get a response.<br><div><br></div><div>I am looking to carry out a fixed window length rolling ADF test (with no intercept), over some time series data currently in xts format.</div><div><br></div><div>To do this I need to first fit a regression to the data, then use the residuals as an input into the ADF test, from which I can get a p-value to see if I can reject the idea of the data having a unit root or not.</div><div><br></div><div>I know I can use fastLm() from RcppArmadillo for the regression, and I know that the ADF test also runs an OLS regression as part of it too, I would have assumed finding unit roots to be a reasonably common use, but currently can’t find any “out of the box” functions that carry out C++ optimised ADF tests, are there any that can easily be sourced/included into Rcpp?</div><div><br></div><div>Secondly, in terms of implementation, originally I was using rollapply(), to carry out my rolling window ADF test, with all lm() calls in both the original regression and the adf test being converted to fastLm() and basically using the adfTest2() function created here (<a href="http://blog.quanttrader.org/2012/04/adftest-function-enhanced-with-rcpp-armadillo/">http://blog.quanttrader.org/2012/04/adftest-function-enhanced-with-rcpp-armadillo/</a>) and put it into a rollapply, but since rollapply() can sometimes be slow, I was wondering if it would make sense to use a for loop to carry out the rolling ADF test instead, and thus was hoping for a Rcpp/RcppArmadillo implementation of the ADF test? is there one?</div><div><br></div><div>I am relatively new to C++, so just to confirm for the fixed window length rolling function would I just be creating a new matrix at each row, which is basically just a subset of the original data that has been put in? and the using the matrix in my function? and would I be overwriting the matrix each time i get to a new row? I think there might be some memory management issues here, so some memory efficient suggested examples would be great!</div><div><br></div><div>Any advice/links on carrying out any part of this would be much appreciated.</div><div><br></div><div>Thanks in advance,</div><div><br></div><div>HLM</div></div></body></html>