1
$\begingroup$

The following works in v11.2-12.0:

ts1 = TimeSeries[{{0, 0}, {1, 1}, {2, 0}, {3, 1}}];
ts2 = TimeSeries[{{0, 1}, {1, 0}, {2, 1}, {3, 0}}];
Covariance[ts1, ts2]
(* -1/3 *)

but fails in v10.0-10.3 with message:

Covariance::vctmat: The arguments to Covariance are not a pair of vectors or a pair of matrices of equal length.

Same problem occurs for TemporalData. However Variance and Mean both work in all of these versions:

Variance[ts1]
(* 1/3 *)

Mean[ts1]
(* 1/2 *)

Bug? Workaround?

$\endgroup$
  • 3
    $\begingroup$ a work-around: Covariance[ts1["Values"], ts2["Values"]] (same for TemporalData)? $\endgroup$ – kglr Sep 13 '19 at 18:48
  • $\begingroup$ It looks to me that this functionality was released in 10.4 (so not a bug) $\endgroup$ – Gosia Oct 22 '19 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.