Hello,
I have trouble using a function that hosts a "Which" function inside a TimeSeriesThread function.
This is a function I wrote, the Which function lies in it :
MyFunction = Function[{ts1,ts2,ts3},
Which[
(ts1-ts2)>=(2*(ts3-ts2)/3),1,
(ts1-ts2)>((ts3-ts2)/3)&&(ts1-ts2)<(2*(ts3-ts2)/3),0,
(ts1-ts2)<=(ts3-ts2)/3,-1]];
Let's suppose I have 3-time series named "TimeS1", "TimeS2" and "TimeS3" with numerical Values only. If I call my function inside a TimeSeriesThread :
TimeSeriesThread[myFunction[First[#],Take[#,2],Last[#]]&,{TimeS1,TimeS2,TimeS3}]["Path"]
the "Path" display prints this instead of the calculated values:
{{3818707200,Which[{0.,2.63041}≥{2.78062,4.53423},1,128.453-{128.453,125.823}> etc
Do you have any idea of how I could run properly my function inside a TimeSeriesThread?
Thank you!