standard deviation with scope #690
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Hi Huifang, |
Beta Was this translation helpful? Give feedback.
-
What I meant is that I have values for the
My understanding is, at the scope level or below, it should apply |
Beta Was this translation helpful? Give feedback.
-
Thank you for the more detailed explanation, I understand the issue now. m["PnL vs Benchmark"] = m["Daily Pnl"] - m["Benchmark"]
m["Std"] = tt.agg.std(m["PnL vs Benchmark"], scope=tt.OriginScope(l["Historical Dates"]))
m["Error tracking"] = tt.where(l["Historical Dates"].isnull(), m["Std"], m["PnL vs Benchmark"]) |
Beta Was this translation helpful? Give feedback.
-
Thanks Daniel! |
Beta Was this translation helpful? Give feedback.
-
Coming back on this ticket, isn't it normal that we have 0 under the scoped level? Maybe I missunderstand the std function but just wanted to make sure we are not creating an issue out of a normal behaviour. |
Beta Was this translation helpful? Give feedback.
Thank you for the more detailed explanation, I understand the issue now.
The behavior you described is correct, the original measure should keep it's values at scope level or below. I'll let you know when we have a fix for this.
In the meantime you can use the
tt.where
function to force the correct value on theHistoricalDate
level: