You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often need to take the time integral of a BeliefsDataFrame, for example, when converting from a power flow to accumulated demand. It would be nice to be able to do this out of the box. Some sub-issues:
The sensor unit is no longer the correct unit for the integral time series.
The event resolution probably needs to be updated, too, maybe depending on the use case for taking the integration. For example, accumulated demand should get an event resolution of timedelta(0) (for instantaneous events).
We could decided to retain the original sensor or create a new sensor on the fly (I'm leaning towards the former).
Grouping by source is required.
Grouping by belief time is required, too. However, for some belief time of event B, its integral should be influenced by the most recent belief of event A (even if one with the same belief time is missing). So this requires some attention.
Taking the integral over probabilistic beliefs requires some probabilistic math, too, and is worth opening up a separate issue for.
The text was updated successfully, but these errors were encountered:
df = BeliefsDataFrame(some_timed_beliefs)
# The integrate method stands for taking the definite time integral with respect to the events
idf = df.integrate()
# The original sensor is retained
idf.sensor == df.sensor
# It follows that
idf.sensor.unit == df.sensor.unit
idf.sensor.event_resolution == df.sensor.event_resolution
# However, the unit and event resolution of the data have changed
idf.unit != df.sensor.unit
idf.event_resolution == timedelta(0)
Two notes:
df.unit is a new BeliefsDataFrame property, next to df.sensor and df.event_resolution. We might want to use pint for unit conversion.
I believe setting the event resolution to zero only makes sense for definite integrals, and not for indefinite integrals. For the latter case, we should retain the original event resolution, and make an assumption about what the event values describe. For example, if the event values describe mean values over sequential time intervals, we could take the assumption that the values within each interval are constant. Then it is possible to determine the indefinite integral, and we can report it's mean value in the original event resolution.
Finally, an example illustrating the belief timing sub-issue for (sequential) events A, B and C:
df (free-form representation)
belief_time A B C
12:00 10 10
13:00 11 12
14:00 11
15:00 12
16:00 11
idf (free-form representation)
belief_time A B C
12:00 10 10 20
13:00 11 23 33
14:00 34
15:00 12 24 35
16:00 23 34
I often need to take the time integral of a BeliefsDataFrame, for example, when converting from a power flow to accumulated demand. It would be nice to be able to do this out of the box. Some sub-issues:
timedelta(0)
(for instantaneous events).The text was updated successfully, but these errors were encountered: