# Modeling and Reasoning of Contexts in Smart Spaces Based on Stochastic Analysis of Sensor Data +
## 5 Experimental Validation
In our experiment, _OPT_ was 0.301 for the training datasets. \[P_{CS}(C_{S})=P_{BN}(C_{S})*O_{BN}(C_{S}) \tag{16}\]  
In the evaluation step, we repeated the entire process with testing datasets, which are generated by Persim 3D, and we obtained \(P_{BN}(C_{S})\), \(O_{BN}(C_{S})\), and \(P_{CS}(C_{S})\). Then, we conducted the validation process by computing _Fidelity_ and deciding _Feasibility_. _Fidelity_ is measured by the ratio of the \(P_{CS}(C_{S})\) of the testing sensor datasets over _OPT_. If the \(P_{CS}(C_{S})\) is below _OPT_, it means that the \(C_{S}\) is unreasonable and irrational to occur. The maximum _Fidelity_ is 100%, which implies that the \(C_{S}\) of the testing dataset occurred in the same probability. However, even though the _Fidelity_ of a \(C_{S}\) is not 100%, it is hard to decide whether it is not yet reasonable. Since \(P_{CS}(C_{S})\) and _OPT_ were calculated by statistical analysis based on probability distribution, this may be adjusted as more training datasets are collected and used. Therefore, we categorized the _Fidelity_ into three states, which increased the flexibility of evaluation. We defined the _Feasibility_ states as falling into the three _Fidelity_ categories, as shown in Table 1. A \(C_{S}\) with 100% _Fidelity_ is classified into the category _Feasible_. If the _Fidelity_ of a \(C_{S}\) is below 100%, yet considerably low, we assume that the \(C_{S}\) may be feasible in certain conditions, and thus accept it even though it is not guaranteed to occur. In our experiment, we analyzed the training datasets to determine the proper range for the category _Possible_ by using Equation (17) and obtained 64%:  
\[F_{ratio}=\frac{\big{|}\big{\{}C_{S_{i}}\bigm{|}P_{CS}(C_{S_{i}})\geq OPT\big{\}} \big{|}}{\big{|}\big{\{}C_{S_{i}}\big{\}}\big{|}} \tag{17}\]  
In Equation (17), \(C_{S_{i}}\) stands for the context schedule obtained from an _i_th dataset, and \(F_{ratio}\) is a ratio representing how many context schedules are beyond the average. This is calculated by the number of \(C_{S_{i}}\) whose occurr \begin{table}
\begin{tabular}{l l l} \hline \hline
**Category** & **Range** & **Perception about a Given \(C_{S_{i}}\)** \\ \hline Feasible & 100\% & Feasible and solid \\ Possible & \(\geq\)64\%, and \(<\)100\% & Probably feasible and acceptable \\ Infeasible & \(<\)64\% & Not feasible \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Three categories for _Fidelity_ by _Feasibility_ states. The _OPT_ of the 11 testing sensor datasets is shown in Table 2. The _Fidelity_ score of six datasets shows 100%, which means that they are _Feasible_, and those of the other three datasets are categorized in the _Possible_ state \(\geq\)64%, and <100%), which means they might be acceptable. Hence, we consider that nine datasets are feasible. On the other hand, the _Fidelity_ score of two datasets (no. 4 and 9) are not in the feasible or possible range, showing that they are below the minimum possible score, which is 64%. This means that the contextual schedules \(\mathbf{C}_{\text{S}}\) of the datasets have very low conditional probability and thus very rarely occur. In summary, the proposed approach's overall success in reasoning contexts is 81%.