currently I am trying to implement a prototype for the following problem. I have data for machines, which sends me how long they have operated in seconds. Further, they have one sensor, which might have a value. So it would look like this
Duration Sensor Value
37 - -
31 se1 A
12 - -
29 se1 A
140 se1 A,B,C
normally, I would expect the sensor to have small variation, but the longer the duration is, the more variation would be expected. In my toy example, I would expect my sensor se1 to have 1 value for average duration, but it would be ok to have 3 distinct values if the duration is significantly longer.
Now, I would like to model it as a Bayesian problem
X := number of distinct values for sensor se1
Y := duration length in seconds
P(X = x | Y = y)
would be my inference such as "how probable is it to get 3 distinct values for a duration of 140 seconds?
"
My approach is
- from the full dataset estimate
P(X)
e.g. viascipy.fit()
- from the full dataset estimate
P(Y)
e.g. viascipy.fit()
- now filter the dataset, such that only observations of se1 are in the filtered set. Consider it as evidence and estimate
P(Y | X)
from it. - use Bayes Theorem to calculate
P(X | Y)
I am not so sure about the 3)
Do I have to filter for "se1 present" or do I have to filter for "se1 has 1 distinct value" then fit, "se1 has 2 distinct values" and fit again, etc.?
EDIT:
Following the ideas from the answer below I have looked into the relationship of duration and occurrence of values:
It is clear that a certain duration is required for higher count of distinct values, but it is not the linear relationship as proposed (I know only as example) in the answer.
Any ideas how I could model this?