Time Series: relating duration of one time series to events I have a stats question, and not enough experience to even begin to know how to find the answer.  It's a time series question relating two time series:
A = anomolous conditions (-,0,+) --- continuous variable
B = # of events --- discrete variable
If I wanted to find out, quantitatively, a threshold of duration under which + anomalous conditions must occur in order for there to be an event, how might one go about doing this? For example, I am more lucky than normal for X consecutive weeks duration before a great opportunity arises. How do I find out the distribution of durations (i.e., my distribution of X)?
I've tried thinking about it and autoregressive analysis won't answer the question because it would simply tell me when the peaks align and the temporal persistence of the anomalous conditions.
I'm looking for key words, methods, links, example problems - anything to point me in the right direction. Any advice is very welcome!
 A: I needed an answer quickly, so I asked here AND among my PhD Statistician friends. I proposed that I conduct a smooth (e.g., moving average) of different time scales that X could be and then conduct lead-/lag- analysis to determine the highest correlation time and compare then across the different scales of X, but this seems clunky. Is there a better way?
Here is the answer they gave me:
Let’s call your “A”, A(t), indicating that it is a function of time, and “B”, B(t).  Let’s suppose B(t) = 0 unless there is an event, and there, B(t) = 1.  Maybe there can be two events at the same time, then B(t) = 2.
I pretty much like your third approach.  Take a window size W and smooth A(t) at that window size to produce A(t;W).  Then look at the joint behavior of A(t;W) and B(t).  
In particular, look at A(t;W) where B(t) = 1.  And, look at the integral of A(t;W) over an interval I, versus the number of events in B(t) over the same interval I.
In general, event data like B(t) are often modeled as Poisson processes in time — like radioactive decay events in a lump of uranium, or lightning strikes in a large fixed area.  Take lightning strikes.  Maybe the rate of lightning strikes over time depends on some external forcing, like clouds.  Then the rate function of the Poisson events can be modeled as controlled by the forcing.  For your problem, maybe the forcing is A(t), and maybe the Poisson rate is A(t;W), or something like A(t;W). Note that the poisson model implies that the waiting times between events follow an exponential distribution.
How you might do this analysis depends on the number of events B(t)!!  If you have a lot of events in a plausible time-window-width W, you might prefer to smooth B (find the number of events in an interval I) and compare to A.  
One quick example of this kind of approach is:
http://people.ee.duke.edu/~lcarin/PoissonProcess.pdf
I’m not suggesting you implement this, just that the authors are good and the references to older work might be useful.
