# Measuring Quality of Service in a Robotized Comprehensive Geriatric Assessment Scenario
## 3 Modelling QoS Metrics for the CLARC Scenario
### QoS Metrics
#### 3.4.2 Deriving Probabilities  
In order to complete the probabilistic network, we need to define the probabilities associated with the variables. It should be noted that probabilities will be derived transparently from the high-level descriptions provided in the previous Sections, which means that users do not have to deal with this complexity and can focus on the application of their QoS metrics. The \"observation\" sentences in the model allows users to establish dependencies on properties, whose quantification is expressed as \(P(Observation|Property)\). **observation**NAME: (PATTERN EXPRESSION) [survival T]  
**(reinforces | undermines)** Property [VERY_HIGH | HIGH | LOW | VERY_LOW]  
We obtain this probability by assuming that the intensity of an observation (VERY_HIGH, HIGH, etc.) indicates the Likelihood Ratio (_LR_). See its definition in Equation (1). Table 1 maps the all intensity values with the corresponding _LR_. Although other assignments are possible, this one has been shown to be effective in our experiments. \[LR=\frac{P(Observation=true|Property=false)}{P(Observation=true|Property= true)} \tag{1}\]  
Figure 2: (Left) Qualitative specification of the Bayesian Network for Performance. (Right) The transition graph for observations. Operating on Equation (2), and assuming \(P(Property)\) and \(P(Observation)\) equal to 0.5, we can obtain Equations (3) and (4), which allows us to calculate the conditional probabilities based on \(LR\). Although we could choose a more elaborate method to initialize the _a priori_ probabilities, the above assumption is a simplification that seems to make sense. For example, in this case, when there is no evidence, the belief of being optimal in terms of a property is reduced to 0.5, which expresses maximum uncertainty. Therefore, 0.5 will be the baseline value for QoS metrics. \[P(Observation=true) =P(Observation=true|Property=true)P(Property=true)+ \tag{2}\] \[+P(Observation=true|Property=false)P(Property=false)\]  
\[P(Observation=true|Property=true)=\frac{1}{1+LR} \tag{3}\] \[P(Observation=true|Property=false)=\frac{LR}{1+LR} \tag{4}\]  
As mentioned in Section 3.4.1, we will consider a continuous-time Markov chain to describe the internal dynamics of the observations. When declaring an observation, we can use the option \"survival\" to specify its average survival time in seconds (denoted as T). Observations gradually lose their significance as time passes, so this parameter configures how long the effect of an observation will last on the estimation of a property. For instance, consider the observation O9 in Listing 3, it undermines Interaction when the calling-the-doctor button is pressed. As soon as the patient presses the button, the urgency is maximum, but as time passes the effect weakens until it eventually disappears. It does not seem very important that a patient pressed the button weeks ago. For the CLARC scenario, we have set the default value of T to 100 min. This value has been chosen to maintain the importance of the observations throughout the test, stabilizing the QoS metrics and making them more robust to the time differences between patients. The transition graph shown in Figure 2 (right) describes how the state of an observation variable evolves over time. Considering that an observation can be in two states: _true_, if it is active, or _false_, when it is not, we can describe the transition rates between states as \(\lambda\) (from _true_ to _false_) and \(\mu\) (from _false_ to _true_). Expression (5) is the resulting transition rate matrix (\(Q\)), where \(\mu\) =0 since the effect of an observation always fades, as we have already mentioned above. \[Q= \begin{pmatrix}-\lambda&\lambda\\ \mu&-\mu\end{pmatrix}  \tag{5}\]  
Finally, the conditional probability of an observation after a period t from its activation (\(P_{t}(Observation|Property)\)) can be determined from \(Q\) with the _Kolmogorov forward equation_, whose particular solution for our problem is shown in Equation (6).