Calculating the conditional probability of a location given a specific time frame

74 Views Asked by At

I am trying to calculate the probability of a user to be at a specific location given a specific time frame.

I have 6 time frames each consisting of 4 hours and each has a list of possible location types:

  1. from 6 to 10 - [home, office, hospital, gas station]
  2. from 1o to 14 - [office, cafe, shop, restaurant]
  3. from 14 to 18 - [office, shop, museum, stadium]
  4. from 18 to 22 - [restaurant, bar, theater, cinema]
  5. from 22 to 2 - [nightclub, pub, bar, home]
  6. from 2 to 6 - [nightclub, home, fast food chain, hospital]

Note: based on the time frame, the probability of each location varies, hence I have decided to assign location types (restaurant, bar, gym, etc. - the types can be assigned to multiple time frames; I do not think the specifics of assignment matter in this particular problem) to a specific time frame.

Each location has its own probability - based on the user's historical data (it is not connected with time frames and location types). This probability is given, there is no need to calculate it.

Based on the aforementioned time frames each location will have a new probability, that will depend on the time frame and the type of the location (e.g. Starbucks has a higher probability in the second time frame since its type is a cafe and will have a lower probability in the sixth time frame since its location type is not in the list for that time frame; hence what I would like to achieve is based on the time frame and the location type I would like to enhance or degrade the original location probability).

I know the locations' individual probabilities and I think that the time probability based on the time frames will be 1/6 since it is not possible to have two time frame occurring simultaneously. I think that the solution to my problem can be a conditional probability, however, I am struggling with the calculation:

$P(L)$ - location's original probability

$P(TF)$ - time frame's occurrence probability

$P(LT)$ - location type probability based on the time frames(this is connected with the time frames and might not be need but I am not exactly sure how to express it)

$P(L | TF | LT)$ or $P(L | TF \cup LT)$

and if it is any of these how will I calculate it.

I hope this edited version makes it clear. I am open to other suggestions of tacking this problem.