Anda di halaman 1dari 20

Modelling Slope Uncertainty in DEMs: Monte Carlo Simulation

Approaches for Error Propagation Work in R software




PART I


1.& 2.
install.packages("sp")
library(sp)
control<-read.delim("U:/UNCERTAINTY/EP/control.txt")
coordinates(control)=~X+Y
spplot(control["h"], col.regions = bpy.colors(), at = seq(850,1170,10))



3.

[850,915]
(915,979.9]
(979.9,1045]
(1045,1110]
(1110,1175]
install.packages("rgdal")
library(rgdal)
dem = readGDAL("U:/UNCERTAINTY/EP/dem30.asc")

4.

str(dem)
Formal class 'SpatialGridDataFrame' [package "sp"] with 4 slots
..@ data :'data.frame': 15000 obs. of 1 variable:
.. ..$ band1: num [1:15000] 1010 1010 1008 1007 1005 ...

dem$band1


5.

control.ov=overlay(dem,control)
str(control.ov)
Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
..@ data :'data.frame': 1020 obs. of 1 variable:
.. ..$ band1: num [1:1020] 939 945 947 949 945 ...
..@ coords.nrs : num(0)
..@ coords : num [1:1020, 1:2] 7394417 7394591 7395095 7395065 7394374 ...
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : chr [1:1020] "12006" "13212" "9929" "10078" ...
.. .. ..$ : chr [1:2] "X" "Y"
..@ bbox : num [1:2, 1:2] 7394258 4842001 7398743 4844994
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : chr [1:2] "X" "Y"
.. .. ..$ : chr [1:2] "min" "max"
..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
.. .. ..@ projargs: chr NA



The overlay gives to an array of x the locations of y. In other words, in our case the file control
gave its own locations to the array of the file DEM. For example the data below shows the
combination of the value with the X,Y of the file Control assigned to the new file Control.ov.

DEM$BAND1
[664] 935.5 923.6 918.5 917.4 913.2 922.1 924.2 922.0 932.9 945.6 958.1 969.4 980.0
Control.ov
Array position X Y Value
674 (7396451, 4844865) 958.1
delta=control.ov$band1-control$h


6.

hist(delta,breaks=15)


summary(delta)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-7.2000 -0.6000 0.1100 0.1858 0.9000 7.8000

Mean = 0.18
sd(delta) =1.486844

Question: Description of histogram. What kind of distribution is it? What is its mean and
standard deviation? What do these statistics say about the quality of the DEM?
The histogram follows a Gaussian distribution and it shows an acceptable error between the
DEM and the control elevation model. This is depicted with a mean of 0.18 meter where the
values closer to the mean value have a large frequency. The standard deviation of 1.48 tells about
the precision of the model represented by the model DEM. The difference between standard
deviation and mean is ca. 1 m. Then, the issue about the precision of the model compared to the
real one (control) depends from the use of these data. For instance, if data will be used for
construction purposes where millimetric precision is required then the precision of our model
will be not good enough.

7.
Histogram of delta
delta
F
r
e
q
u
e
n
c
y
-5 0 5
0
5
0
1
0
0
1
5
0
2
0
0
2
5
0
3
0
0



DEM30

8.



Random DEM30
Mean 0.18
St. Deviation 1.48

Question: Modul description
The modul RANDOM in Idrisi creates image with random values with a distribution that in our
case was chosen as normal.
This modul is usefull when Montecarlo method is taken in consideration.
Question: What does it look like?
The legend in the new image shows expected errors values of the original DEM30 with
distribution error from -4.91 to 5.54
Question: Can you identify any structure in the surface at all?
No, it is not possible identify any structure. This might depend that values are randomly
distributed on the new image without any spatial correlation.
9.


Mean = 0.18
sd(delta) =1.486844

Question: What does this random surface represent?
The error distribution of the random data calculated by Random in Idrisi looks different from the
one in Delta. Though, there are similar mean and standard deviation of the errors for both the
models. This perhaps is due to an absence of correlation between data in the Random error
model. The random surface represents a simulated error surface based on the surface called
Delta.


10.

Created 50 errors random surfaces with mean equal to 0.18 and standard deviation equal to 1.48.




Histogram of delta
delta
F
r
e
q
u
e
n
c
y
-5 0 5
0
5
0
1
0
0
1
5
0
2
0
0
2
5
0
3
0
0
11.





The figure B shows the difference in the model when we add the errors to the original raster. The
result of it is a different image compared with the original where contours appear blur. Values
are close to the original ones because this is visible in the different of scale in the legend where
maximum and minimum values are slightly different. One closer look at the disturbed image the
difference for an accurate analysis could be crucial if that difference is around 10 meter. The
yellow and green zones (991 m-1012 m) in the two pictures can be located differently if the scale
of observation is small.
However, the two images still have the same shape of slopes. Thus, it still possible to notice the
same contours in the disturbed DEM.


12.

The surface calculates the slope based on the resolution and values of their neighbor around the
cells. The resultant vector (slope) of X and Y for the slope is calculated as follows:


FIGURE B
DISTURBED DEM30
FIGURE A
UNDISTURBED DEM30



The two images are clearly different in quality. The disturbed Dem30dist_slope have lost a lot of
details about the slope at small resolution. For example, it is not visible anymore the line
where slope is between 0 and 0.01 degrees. However, it still possible to distinguish clusters in
different regions of the raster and their contours.






13.

50 realizations



14.

Slope on realizations


























15.


Mean of 50 realizations of slope



Original slope from Dem30
Question: What is the essential difference in this case?

In this case for Mean of 50 realizations of slope the values are not correct. There are locations
where the value looks very different from that one in the original slope of Dem30.







Standard deviation slope


16.


Standard deviation/mean slope
Question: Where is the slope more reliable and least reliable?
Is there any relationship between relative error and elevation? Or relative error and slope
value?


RSE =



High values of RSE (Relative Standard Error) indicate a high variability in the dataset, thus those
values are less reliable and vice-versa there RSE values are low data are more reliable because
there is less variance around the mean.
Since we dont know the actual value then we use the measured value that in our case is the
slope value. That means that there is a relationship between relative error and elevation. This can
be explained by saying that the true value will be represented by the measurement of its
relative error. The lower the relative error is the better the slope will match to the unknown true
value.






























PART II

1. Delta.vg<- variogram(delta~1, control)
plot(deltavg)



Question: Does the spatial autocorrelation structure of the errors in the DEM affect the
outcome of the error propagation procedure we tested for the slope?

The variogram shows that exists dependence between the errors contained in Delta. The
autocorrelation of errors in the DEM affects the procedure for the slope. The errors in the model
will be taken from the calculation of slope errors procedure since it will inherit those errors from
the model.
In case of spatial independence, the DEM will not be affected since errors in elevation of each
point will not be considered but only the value of its neighbors. As earlier explained, the
calculation of slope is based on cell resolution and value of their neighbors.

2. delta.mvg<-fit.variogram(delta.vg, model = vgm(1, "Exp", 700, 1))
plot(delta.vg,delta.mvg)

distance
s
e
m
i v
a
r
i a
n
c
e
0.5
1.0
1.5
2.0
500 1000 1500
distance
s
e
m
i
v
a
r
i
a
n
c
e
0.5
1.0
1.5
2.0
500 1000 1500
Nugget= 1.5
Sill= 1.8
Range= 700
3. delta.ok=krige(delta~1,control,dem,delta.mvg,nmax=80)
spplot(delta.ok[1],col.regions=bpy.colors(),at=seq(-5,5,0.2))


Figure 1 Errors generated by Kriging Interpolation using Gstat function in R



Figure 2 Errors generated by function Random in Idrisi
The Kriging interpolated errors surface has an own structure that differs much from that one computed in Idrisi. It is
not possible to observe any elevation structure as the original one in DEM. That suggests that maybe in the case of
Kriging errors interpolation the spatial autocorrelation structure is not followed.
On the other hand, this does not mean that what Kriging is showing us is totally wrong. The predicted errors of
Kriging could just give a better representation of the real DEM where errors in input data should be equal with
those shown in the Kriging map in figure 1.








-4
-2
0
2
4

4.
hist(delta.ok$var1.pred)


Question: Are there any major differences in the statistics between the two (delta.ok
VS delta histogram)?

Errors in Delta.ok are further from mean of zero and its distribution looks asymmetrical
respect to that one in Delta. However, the mean is close to that one in Delta equal to
0.16908.






















Histogram of delta.ok$var1.pred
delta.ok$var1.pred
F
r
e
q
u
e
n
c
y
-1.0 -0.5 0.0 0.5 1.0 1.5 2.0
0
1
0
0
0
2
0
0
0
3
0
0
0
4
0
0
0
Histogram of delta
delta
F
r
e
q
u
e
n
c
y
-5 0 5
0
5
0
1
0
0
1
5
0
2
0
0
2
5
0
3
0
0
5. delta.sim=krige(delta~1,control,dem,delta.mvg,nmax=50,nsim=2)
spplot(delta.sim[1],col.regions=bpy.colors(),at=seq(-5,5,0.2))


Figure 3 Conditional Gaussian Simulation


Figure 4 Random Simulation in Idrisi

The conditional Gaussian simulation Errors (figure 3) generated with gstat function looks
very similar with that done in Idrisi(figure 4). The only different is that in the Guassian
simulation is possible to note some cluster of errors that often represent those errors
where standard deviation from mean if very high (blue and yellow zones in figure 3).

-4
-2
0
2
4

6.

hist(delta.sim$sim1) & hist(delta.sim$sim2)

Figure 6 Delta histogram errors of DEM



Figure 8 Conditional Gaussian Simulation errors Sim1

The histogram of the conditional Gaussian simulation gives us a better normal
distribution of the errors (figures 8, 9). Data are symmetrical with a mean 0.1159 for
delta.sim$sim1 (fig. 8). Standard deviation is 1.35 for delta.sim$sim1 that is lower than
that one in Delta equal to 1.48. This mean that data in the Gaussian simulation are closer
to the mean of the errors. In other words, the values that are further spread out are those
values represented in yellow and blue colors in the map in figure 3.





Histogram of delta
delta
F
r
e
q
u
e
n
c
y
-5 0 5
0
5
0
1
0
0
1
5
0
2
0
0
2
5
0
3
0
0
Histogram of delta.sim$sim1
delta.sim$sim1
F
r
e
q
u
e
n
c
y
-4 -2 0 2 4
0
5
0
0
1
0
0
0
1
5
0
0
2
0
0
0
Histogram of delta.ok$var1.pred
delta.ok$var1.pred
F
r
e
q
u
e
n
c
y
-1.0 -0.5 0.0 0.5 1.0 1.5 2.0
0
1
0
0
0
2
0
0
0
3
0
0
0
4
0
0
0
Figure 5 Delta.ok histogram errors simulation
Histogram of delta.sim$sim2
delta.sim$sim2
F
r
e
q
u
e
n
c
y
-4 -2 0 2 4
0
5
0
0
1
0
0
0
1
5
0
0
2
0
0
0
Figure 7Figure 7 Conditional Gaussian
Simulation errors Sim2
7. --


8.

50 realizations of Conditional Gaussian Simulation

9.


Figure 9 Developing 50 realizations of DEM surface by using
the errors generated by Gaussian conditional simulations.



Figure 10 Results of 50 Realizations produced by using Gaussian Simulation

10.



Figure 11 Slope autocorrelation of all 50 disturbed DEMs


11.


Figure 12 Mean and SD of the disturbed slopes

Figure 16 Standard Deviation of slope (Part I 15)

Figure 13 Mean and SD of the disturbed slopes
12.





Figure 14 Standard Deviation of autocorrelation slope (PartII 11 )


Figure 16 Mean Autocorrelation slope (PartII 11)

The mean and the standard deviation from both simulation look alike. It is very difficult to see any difference.


Figure 17 Mean slope (PartI 15)
13.








The result of RSE looks similar with low values at the same positions and higher values almost at the same position
too in the center of the DEM. That means that both results equally describe if predicted data are reliable in our
model.



14.

With a stronger spatial autocorrelation in error sample, all errors will be strongly correlated and will not have a
mean of errors equal to 0. The elevations will have a systematic error that will lead to get some predictable model
that will depict as best as possible the true observed dataset.

Anda mungkin juga menyukai