I have used several interpolation methods to create digital elevation models from a trainings data set. Now, I would like to assess the quality of each DEM by calculating the Root mean square error using an independent validation data set. I have already used the "Point sampling tool" which created a new shapefile with extracted heights from a DEM.
In the past, I have used an R script to calculate the RMSE and would like to use this script in QGIS. However, I am struggling with defining the parameters, can someone help here?
This is my R script that I would implement in a QGIS Rscript:
dif2 <- array(NA, c(dim(val.data)[1], 2))
# creates an array with 2 columns and n rows (length of Validation data)
for (i in (1:dim(val.data)[1])) dif2[i,1] <- val.picked[i,4] - val.data[i,4]
# calculates the differnce between grid value and measured value and saves it result into first column of array "dif2"
for (i in (1:dim(val.data)[1])) dif2[i,2] <- dif2[i,1]^2
# calculates the square of the difference and saves it into second column of array)
RMSE <- sqrt(mean(dif2[,2],na.rm=T))