Download pdf, 2 MiB - Infoscience
Transcript
4.3. Model Description Language ✞ 1 ☎ / / Gaussian Model f o r D i s t r i b u t e d Sensors 2 3 4 5 6 7 8 / / * * * Learning Functions * * * f o r a l l s i in S : s i .m = avg ( f o r a l l t = 1 . . 1 0: s i . temp [ t ] ) ; f o r a l l s i in S , s j in s i . neighbors : C[ s i , s j ] = avg ( f o r a l l t = 1 . . 10 : ( s i . temp [ t ] − s i .m) * ( s j . temp [ t ] − s j .m) ) ; 9 10 11 12 13 14 15 16 17 18 19 / / * * * P r e d i c t i o n Functions * * * f ( node s i ) = f o r a l l s j , sk in s i . neighbors where s j ! = sk : X1 [ 1 , s j ] = C[ s i , s j ] , X2 [ s j , sk ] = C[ s j , sk ] , X3 [ sk , 1] = sk . sensor − sk .m, X4 [ s j , 1] = C[ s j , s i ] , f ( s i ) = s i .m + ( X1 * inv ( X2 ) * X3 ) [ 1 , 1 ] , f . err ( s i ) = C[ s i , s i ] − ( X1 * inv ( X2 ) * X4 ) [ 1 , 1 ] ; ; ✝ ✆ Listing 4.3: Multivariate Guassian Random Variables Model implementation, the covariance matrix only contains values for neighboring sensors. Lines 11– 19 define the prediction function, which combines the model parameters with the known sensor readings to predict the missing sensor readings. The particularity of this prediction function is that it defines an error estimate for each prediction (Line 19). 4.3.3 Wind-flow Model The model of the wind flow over a mountain ridge, which we introduced in Section 3.2, can be expressed in our sensor data model language. The model represents the real situation with measurements on grid points. After determining the initial condition at the grid points, the model determines the likely future development by calculating new values at the grid point for small time increments. For this type of model, data from a wireless sensor network can be used to determine the initial condition of the system. The sensor nodes might not always be located at the exact locations of the grid points as these locations might be difficult to access. Thus, e.g., a statistical model might be used to determine the initial condition from the actual sensor readings. In our simplified wind model, the initial condition is given by a set of functions describing uniform wind flow. The wind flow model is quite complex compared to the probabilistic models presented in this thesis, and the exact formulation of the individual equations provide no additional information relevant for this discussion. For this reason, only the most relevant portions of the model, as expressed in our sensor data model language, are shown in Listing 4.4. In particular, we concentrate on the prognostic functions that compute the new values for the next time step, 51