# Is there a way to cross-correlate two timeseries, but only when one of them rises?

I'm following two timeseries: one is a setpoint, the other is the controlled output. When the setpoint rises I want the controlled output to follow quickly; when the setpoint drops, it's acceptable to have the output drop more slowly.

Is there a metric that can quantify this behaviour? Some kind of "positive cross-correlation"?

Here is a plot of the two signals I'm following. The red line is the setpoint, the orange line is the output signal.

I think the concept of "cross-correlation" can be handled through copulas.

A copula is the joint distribution of random variables U1, U2, . . . ,Up, each of which is marginally uniformly distributed as U(0, 1) (source)

Thanks to the Sklar's theorem,

we can describe the joint distribution of $X_1$, $X_2$, . . . , $X_p$ by the marginal distributions $F_j(x)$ and the copula $C$ (source)

Through modelling and fitting a copula, you will describe a "positive cross-correlation behavior". You can see here a few examples of copula functions. I guess what you are looking for is perhaps a Gumbel copula and your goal would be to fit $\alpha$ (see here for more details)

Hope this helps.

• Thanks for your answer; I'm not sure I fully understand it though. Is there a paper or some reference you could point me to? I've tried following the presentation you linked to, but I'm not sure I understand how to apply this to my problem. – lindelof Jul 3 '17 at 6:07
• Maybe this helps? de.mathworks.com/help/stats/examples/… – IcannotFixThis Jul 4 '17 at 7:35