KWR-Water / pysimdeum

SIMDEUM in python
European Union Public License 1.2
15 stars 7 forks source link

prob_joint = normalize(prob_user * prob_usage) #12

Open Mirjam-blokker opened 2 years ago

Mirjam-blokker commented 2 years ago

in simulate, you find: prob_joint = normalize(prob_user * prob_usage)

In the Matlab version I have coded this a bit differently. In case there is a prob_usage that is not only 1's (e.g. for the kitchen tap), this pdf is prevailing. Only when the users are not present, then a correction is made. This means that prob_user is first converted to 0 (not present) and 1 (present), but without the information on peak, night, away included. Of course when prob_usage is only 1's, then prob_user is prevailing, and the information on peak, night and away is used.

Yukun-Xie commented 1 year ago

This problem can be solved by appling bool calculation. Besides, the joint probability can be calculated outside the 'for' cycle and normalized in the cycle(reduce the number of operations).