













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














2.1 Definitions The Space/Time Random Field (S/TRF) X( p ) = X( s ,t) is a random variable that is a function of location s =(s 1 ,s 2 ) and time t. The space/time covariance between space/time points p and p’ is cX ( p , p’ ) = E [( X( p ) - mX( p ) )( X( p’ ) - mX( p’ ) )] 2.2 Homogeneous / Stationary S/TRF A homogeneous/stationary S/TRF has the following properties: It’s mean trend is constant, mX( p )= mX
Are the following s/t covariance homogeneous/stationary? Homogeneous/stationary Separable cX ( p , p’ ) = c 0 exp-|| s + s’ || exp-| tt’ |
17
2. The covariance of Space/Time Random Fields (S/TRF) 2.1 Definitions The Space/Time Random Field (S/TRF) X( p ) = X( s ,t) is a random variable that is a function of location s =(s 1 ,s 2 ) and time t. The space/time covariance between space/time points p and p’ is cX ( p , p’ ) = E [( X( p ) - mX( p ) )( X( p’ ) - mX( p’ ) )] 2.2 Homogeneous / Stationary S/TRF A homogeneous/stationary S/TRF has the following properties: It’s mean trend is constant, mX( p )= mX
Are the following s/t covariance homogeneous/stationary? Homogeneous/stationary Separable cX ( p , p’ ) = c 0 exp-|| s + s’ || exp-| tt’ | NO n/a
18
2.4 Displaying a separable s/t covariance for homogeneous / stationary S/TRF cX ( r, ) is a 2D function that can be displayed as a surface cX ( r, ) is a slice of that surface for . It shows the spatial component cX ( r , ) is a slice of that surface for r . It shows the temporal component 20
2.5 Estimating a s/t covariance A useful equation to calculate the covariance of a homogeneous/stationary S/TRF is cX ( r, )= E [ X( s, t)X( s’, t’) ] (^) || s - s’ ||= r , | t-t’ |= - mX 2 When having site-specific data , and assuming the SRF is homogeneous/stationary , we may estimate the covariance value for a given spatial lag r and temporal lag using the following estimator 2 , (, ) ( , )^1 , 1 ˆ (^) ( , ) taili X N r c (^) X r (^) N r i (^) XheadiX m where N( r ,) is the number of pairs of points with values ( X head, X tail) separated by a distance of r and a time of . In practice we use a tolerance d r and d , i.e. such that r - d r ≤ || s head- s tail|| ≤ r +d r and -d ≤ || t head- s tail|| ≤ +d 21
Conversion of space/time data formats in BMElib Conversion between space/time grid and space/time vector formats stgridsyntax - Syntaxical help for s/t grid format valstg2stv - Converts values from s/t grid coord to s/t vector coord valstv2stg - Converts values from s/t vector coord to s/t grid coord probastv2stg - Converts probabilistic data from s/t vector coord to s/t grid coord probastg2stv - Converts probabilistic data from s/t grid coord to s/t vector coord A game: where should all these functions be located? (help iolib) 23
help stgridsyntax stgridsyntax - Syntaxical help for s/t grid format (Jan 1,
CONTENT OF HELP FILE: When the data are collected at a fixed set of nMS Monitoring Sites with coordinates cMS for nME time events, then one can use the s/t grid format to store the space/time data. In this case the locations of the Monitoring Sites are stored in the nMS by 2 vector cMS=[s1MS s2MS], the time of the nME Monitoring Events are stored in a 1 by nME vector, and the space/time data is stored in a nMS by nME matrix Z, as shown in the following example: tME=[100 200 300 400]; cMS=[10 10; Z= [1 4 7 10; 20 20; 2 5 8 11; 30 30]; 3 6 9 12]; One can convert the data from s/t grid format to s/t vector format where each data value is associated with a s/t location. Hence the values are in a nMSnME by 1 vector z to which is associated the locations ch=[s1,s2,t], where s1, s2, and t are nMSnME by 1 vectors for the s1 spatial coordinates, s2 spatial coordinates, and time, respectively. For example converting the above s/t grid data to s/t vector format is done by using the following command : [ch,z]=valstg2stv(Z,cMS,tME); And the result is as follow in s/t vector format s1 s2 time z ch=[10 10 100; z=[1; 20 20 100; 2; 30 30 100; 3; 10 10 200; 4; 20 20 200; 5; 30 30 200; 6; 10 10 300; 7; 20 20 300; 8; 30 30 300; 9; 10 10 400; 10; 20 20 400; 11; 30 30 400]; 12]; Additionally the data can be converted from s/t vector to s/t grid format as follow [Z]=valstv2stg(ch,z,cMS,tME); Note that the commands probastv2stg and probastg2stv do a similar conversion on probabilistic data. 24
In BMElib the function used to estimate the s/t covariance of a homogeneous/stationary S/TRF using data in s/t grid format is stcov.m SYNTAX : [C np]=stcov(Zi,cMSi,tMEi,Zj,cMSj,tMEj,rLag,rLagTol,tLag,tLagTol); INPUT: cMSi=[- -; spatial coordinates of nMS monitoring stations
3. The cross-covariance between two Random Fields 3.1 Definitions Let X( p ) and Y( p ) are two random fields_._ The cross-covariance between X at point p and Y at point p’ is cXY ( p , p’ ) = E [( X( p ) - mX( p ) )( Y( p’ ) - mY( p’ ) )] = E [ X( p )Y( p’ ) ]- mX( p ). mY( p’ ) If X( p ) and Y( p ) are homogeneous/stationary S/TRF then the covariance is given by
3.2 Estimation a cross-covariance Using site-specific data, for two homogeneous/stationary S/TRFs the cross-covariance is given by taili X Y N r c (^) XY r (^) N r i (^) XheadiY , m m (, ) ( , )^1 , 1 ˆ ( , ) where N( r ,) is the number of pairs of points with values ( X head, Y tail) separated by a distance of r and a time of . In practice we use a tolerance d r and d , i.e. such that r - d r ≤ || s head- s tail|| ≤ r +d r and -d ≤ || t head- s tail|| ≤ +d 27
3.4 Review of the BMElib functions for covariance estimation pairsplot - display pairs of points separated by a given distance interval pairsindex - finds pairs of points separated by a given distance interval covario - covariance and cross covariance estimation a set of variables which are known at the same set of spatial coordinates crosscovario - single cross covariance function estimation crosscovarioST - space/time cross covariance estimation for s/t vector data stcov - space/time cross covariance estimation for s/t grid data 29
Appendix: The covEstimationSTv.m and covEstimationSTv.g Tutorials Exploratory analysis and covariance estimation for Space/Time Random Fields (SRF) X(s,t) Space/Time Random Field (S/TRF) X( s ,t) take values that changes both as a function of the spatial location s =[ x,y ] as well as time t. The hard data (exact measurements) of the S/TRF may typically be available in two type of format. In the first format which we will call STg (for Space Time grid), there are a set of nMS monitoring stations at location cMS =[[ x 1 ,y 1 ];…], and the measurements occurred at a set of nME monitoring event (at time tME=[ t 1 ,… ] that are the same for all monitoring stations (hence resulting in nMS*nME measurements). In the second format which we call STv (for Space Time vector), each location is sampled at a different time, hence in this case the data is listed as a set of nh measurements corresponding to space/time nh points p h =[[ x 1 ,y 1 ,t 1 ],…]. The markerplot.m command may be used to provide a maps showing the hard data at different time intervals. Hence a sequence of such maps will provide a "movie" showing the spatiotemporal variation of the data. When using space/time data in the STv (Space/Time vector) format, the crosscovarioST.m command may be used to estimate experimental values of the covariance as a function of spatial lag and temporal lag. The covEstimationSTv.m command is a tutorial showing how to use this command, and an example is presented in the following pages. The program covEstimationSTv.m itself is printed at the end of this appendix. When using space/time data in the STg (Space/Time grid) format, the stcov.m command may be used to estimate experimental values of the covariance as a function of spatial lag and temporal lag. The covEstimationSTg.m command is a tutorial showing how to use this command, and an example is presented in the following pages after the example for the STg format. The program covEstimationSTg.m itself is printed at the end of this appendix. i
Space/Time Random Field (S/TRF) X( s ,t) in STg format with a separable exponential covariance. The model selected is C(r, )=C 0 exp (-3 r/ar) exp (-3 t/at) where the sill (variance) C 0 =1.3, the spatial range ar =13 Km , and the temporal range at =11 days. iii
The covEstimationSTv.m Program % covEstimationSTv - covariance estimation tutorial using data in S/T vector format %%% ESTIMATION OF COVARIANCE USING SPACE/TIME VECTOR DATA %%% ----------------------------------------------------- %%% Read the hard data from file [val,valname,filetitle]=readGeoEAS('covstv.dat'); ch=val(:,1:3); zh=val(:,4); th=ch(:,3); %%% Open a new graphic window and display the hard %%% data that were measured between day 0 and day 5, %%% using circles having a size which is proportional %%% to value of the hard data. figure; markerplot(ch(0<=th&th<5,1:2),zh(0<=th&th<5),[4 30]); xlabel('x (Km)');ylabel('y (Km)'); title('Markerplot of data for time 0 to 5 days'); %%% Open a new graphic window and display the hard %%% data that were measured between day 5 and day 10, %%% using circles having a size which is proportional %%% to value of the hard data. figure; markerplot(ch(5<=th&th<10,1:2),zh(5<=th&th<10),[4 30]); xlabel('x (Km)');ylabel('y (Km)'); title('Markerplot of data for time 5 to 10 days'); %%% Open a new graphic window and display the hard %%% data that were measured between day 10 and day 15, %%% using circles having a size which is proportional %%% to value of the hard data. figure; markerplot(ch(10<=th&th<15,1:2),zh(10<=th&th<15),[4 30]); xlabel('x (Km)');ylabel('y (Km)'); title('Markerplot of data for time 10 to 15 days'); %%% Open a new graphic window and display the hard %%% data that were measured between day 15 and day 20, iv
t=0:.2:15; covmodel='exponentialC'; covparam=[1.3 9]; subplot(2,1,2); modelplot(t,covmodel,covparam); ylabel('Covariance C(r=0,t)'); xlabel('temporal lag t (Day)'); vi
The covEstimationSTg.m Program %%% ESTIMATION OF COVARIANCE USING SPACE/TIME GRID DATA %%% --------------------------------------------------- %%% Read the hard data from file [val,valname,filetitle]=readGeoEAS('covstg.dat'); cMS=val(:,1:2); Zh=val(:,3:end); nME=size(Zh,2); tME=1:nME; %%% Estimate the covariance by using pairs in all %%% directions. rLag= [0.0 2.0 4.0 8.0 14.0]'; rLagTol=[0.0 1.5 2.0 4.0 6.0]'; [Cr npr]=stcov(Zh,cMS,tME,Zh,cMS,tME,rLag,rLagTol,0,0); tLag= [0:10]; tLagTol=[0 0.01*ones(1,length(tLag)-1)]; [Ct npt]=stcov(Zh,cMS,tME,Zh,cMS,tME,0,0,tLag,tLagTol); %%% Plot the estimated covariance values on a new graphic %%% window figure; subplot(2,1,1);hold on; plot(rLag,Cr,'.r:'); plot([0 15],[0 0],'k-'); ylabel('Covariance C(r,t=0)'); xlabel('spatial lag r (Km)'); title('Covariance'); subplot(2,1,2);hold on; plot(tLag,Ct,'.r:'); plot([0 15],[0 0],'k-'); ylabel('Covariance C(r=0,t)'); xlabel('temporal lag t (Day)'); %%% A reasonable model is an separable space/time %%% covariance with a sill (variance) cc=1.3, %%% an exponential spatial component with a range aa=13 Km, vii