Lag in financial trading vs Group Delay in signal processing I'm a newbie to Signal Processing - and so I'm providing a "background" and a "question" section separately. 



Background:

Suppose I have a linear filter (w.r.t. given as 

$\theta_{t+1} = \theta_t + \lambda (x_t - \theta_t)$

In Financial Trading, such a filter is often called an exponential moving average, often applied to both prices (to get smoothened prices) and to square of price returns (to get "EWMA" volatility). By conventional definition:

$\lambda =  \frac{2}{n+1}$, where $n$ is periods (example $20$-day EWMA volatility). 

Usually, a lot of folks in Financial Trading define "lag" as the expected value of the filter, when $x_u$ is replace by $t-u$. For instance, the above filter can also be written as 

$\theta_{t+1} = \lambda (x_t+(1-\lambda) x_{t-1}+ (1-\lambda)^2 x_{t-2}+ ...)$

To get the "lag" of this filter in Financial Trading, we write

$L(\theta) = \lambda (0+(1-\lambda) 1+ (1-\lambda)^2 2+ ...)$

which gives

$L(\theta) = (1-\lambda)/\lambda = \frac{n-1}{2}$. 



Question:

Now suppose I have a filter that is non-linear in $\theta$. Example, suppose it is 

$\theta_{t+1} = \theta_t + \lambda \frac{1}{2}(x_{t}^2 e^{2\theta_t}-1)$

I have no idea what would be the equivalent of a lag here. Some folks told me that the definition of lag in Financial Trading is equivalent to the group delay (or may be phase delay) in Signal Processing. 

(1) I looked up the definition of group delay and phase delay (e.g. on Wiki), but I couldn't exactly relate them to the definition of lag in Financial Trading. For the linear example:

$\theta_{t+1} = \theta_t + \lambda (x_t - \theta_t)$

what would be the group delay (or may be phase delay if that's more equivalent)?

(2) For the non-linear example:

$\theta_{t+1} = \theta_t + \lambda \frac{1}{2}(x_{t}^2 e^{2\theta_t}-1)$

what would be the group delay / phase delay or the equivalent of lag as applied to the linear filters in Financial Trading?
i'm gonna work on this using the EE DSP notation i think is most conventional in the EE DSP field.  your exponentially-decaying 1-pole filter has this simple difference equation:

$$ y[n] = (1-p) \, x[n] \ + \ p \, y[n-1] $$

turns out (as we shall see below) that $p$ is the pole.  applying the Z transform gets you

$$ Y(z) = (1-p) \, X(z) \ + \ p \, z^{-1}Y(z) $$

from which we can solve for the transfer function:

$$ H(z) \triangleq \frac{Y(z)}{X(z)} = \frac{1-p}{1-p\,z^{-1}} = (1-p)\frac{z}{z-p} $$

so there is a zero at $z=0$ and a (real) pole at $z=p$.  the zero would go away if we took our input from $x[n-1]$ instead of $x[n]$ which would create a pole at $z=0$ and cancel the zero, but all that does is introduce another sample period of delay.  i don't think you wanna do that.

the (Kronecker) impulse response is

$$ \begin{align}
h[n] &amp; = (1-p) p^n u[n] \\
&amp; = (1-p) e^{\log(p) \, n} u[n] \\
&amp; = (1-p) e^{n / \tau} u[n] \\
\end{align} $$

where u[n] is the Heaviside unit step function

$$ u[n] \triangleq
\begin{cases}
1, &amp; \text{if }n \ge 0 \\
0, &amp; \text{if }n &lt; 0
\end{cases} $$

and $\tau$ is the "time constant" of the decaying exponential.  in order for the filter to be stable, the exponential must be decaying which means that $\tau &gt; 0$, $\log(p) &lt; 0$, and $0 &lt; p &lt; 1$

okay, so now the complex frequency response of $H(z)$ is

$$ \begin{align}
H(z)\bigg|_{z=e^{j\omega}} = H(e^{j\omega}) &amp; = \frac{1-p}{1-p \, e^{-j\omega}} \\
&amp; = \frac{1-p}{1-p \, \left(\cos(\omega) + j\sin(\omega) \right)} \\
\end{align} $$

the magnitude response is

$$ \begin{align}
|H(e^{j\omega})| &amp; = \left|\frac{1-p}{1-p \, e^{-j\omega}} \right| \\
&amp; = \left| \frac{1-p}{1-p \, \left(\cos(\omega) + j\sin(\omega) \right)} \right| \\
&amp; = \frac{1-p}{\sqrt{ (1-p\cos(\omega))^2 + (p\sin(\omega))^2 }} \\
&amp; = \frac{1-p}{\sqrt{ 1 + p^2 - 2 p \cos(\omega) }} \\
\end{align} $$

this is pretty familiar.  less oft observed is the phase response

$$ \begin{align}
\phi(\omega) \triangleq \arg \{ H(e^{j\omega}) \} &amp; = \arg \left\{ \frac{1-p}{1-p \, e^{-j\omega}} \right\} \\
&amp; = \arg \{ 1-p \} - \arg \{1-p \, e^{-j\omega} \} \\
&amp; = 0 - \arg \{1-p (\cos(\omega) + j \sin(\omega)) \} \\
&amp; = - \arctan \left( \frac{p \sin(\omega)}{1-p \cos(\omega)} \right) \\
\end{align} $$

the phase delay is

$$ \tau_\phi(\omega) \triangleq -\frac{\phi(\omega)}{\omega} $$

and the group delay is

$$ \tau_g(\omega) \triangleq -\frac{d\phi(\omega)}{d\omega} $$

gotta go.  i'll post this now and finish it later.  perhaps someone else wants to finish it.