I Approximate new acorrelation given previous acorrelation and a new set of data?

AI Thread Summary
The discussion focuses on approximating the autocorrelation coefficient ##\rho## when new data is introduced without recalculating from scratch. It highlights the need to multiply out terms in the autocorrelation formula to facilitate the approximation. By separating the sums of the terms, a new expression for ##\rho_k## is derived that incorporates the new data. The conversation emphasizes the importance of maintaining running sums for efficient computation. Ultimately, the approach requires careful coding and thorough testing to ensure accuracy.
member 428835
Hi PF!

The autocorrelation coefficient ##\rho## is defined as $$\rho_k \equiv \frac{\sum_{t=k+1}^T (x_t - \bar x)(x_{t-k} - \bar x)}{\sum_{t=1}^T(x_t-\bar x)^2}$$

Now suppose we calculate ##\rho## through ##T##, but are then given a new data at time ##T + \Delta t##. Is there a way to approximate the new autocorrelation without recalculating from scratch? Obviously if we use the definition we'd have to recalculate the mean ##\bar x## and therefore the entire computation.
 
Mathematics news on Phys.org
joshmccraney said:
Is there a way to approximate the new autocorrelation without recalculating from scratch?
Yes, can you multiply out the terms in ## (x_t - \bar x)(x_{t-k} - \bar x) ## and ## (x_t-\bar x)^2 ##?
 
pbuk said:
Yes, can you multiply out the terms in ## (x_t - \bar x)(x_{t-k} - \bar x) ## and ## (x_t-\bar x)^2 ##?
##\bar x^2 - \bar x x_{t-k}- \bar x x_{t} + x_t x_{t-k}## and ##\bar x^2 -2 \bar x x_{t} + x_t ^2##
 
joshmccraney said:
##\bar x^2 - \bar x x_{t-k}- \bar x x_{t} + x_t x_{t-k}## and ##\bar x^2 -2 \bar x x_{t} + x_t ^2##
Excellent, now you can sum over the terms separately:
$$ \rho_k \approx \frac{
\sum_{t=k+1}^T \bar x^2
- \sum_{t=k+1}^T \bar x x_{t-k}
- \sum_{t=k+1}^T \bar x x_{t}
+ \sum_{t=k+1}^T + x_t x_{t-k}
}{
\sum_{t=1}^T \bar x^2
- 2 \sum_{t=1}^T \bar x x_{t}
+ \sum_{t=1}^T x_t^2
} $$
and finally rewrite all the ## \bar x ## terms e.g.
$$ \sum_{t=k+1}^T \bar x x_{t-k} = \bar x \sum_{t=k+1}^T x_{t-k} = \frac 1 T \sum_{t=1}^T x_t \sum_{t=k+1}^T x_{t-k} $$
Then you "just" need to
  1. translate that all into code which keeps track of the running sums
  2. test it thoroughly
  3. rewrite it to pick up mistakes in my or your algebra
  4. test it again
Good luck!
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top