Description Usage Arguments Details Value Author(s) References See Also Examples
Functions correctionpoint
and correctionpoints
perform correction of predicted climatic data by applying statistical correction methods (unbiasing, scaling, or quantile mapping) to meteorological variables. Function correctionpoints.errors
allows evaluating, for each point, the bias and mean absolute error (MAE) obtained before and after correcting the climate model for the historical period.
1 2 3 4 5 6 7 8 | correctionpoint(obs, mod, proj, dates = NULL,
params = defaultCorrectionParams(), verbose=TRUE)
correctionpoints(object, points, topodata = NULL, dates = NULL,
export = FALSE, exportDir = getwd(), exportFormat = "meteoland/txt",
metadatafile = "MP.txt", corrOut = FALSE, verbose = TRUE)
correctionpoints.errors(object, points, topodata = NULL,
error.type="residuals.cv",keep.data = FALSE, verbose = FALSE)
|
obs |
A data frame with observed meteorology. |
mod, proj |
Data frame with predicted meteorology for the reference and projection periods, respectively. |
params |
A list with correction params (see |
object |
An object of class |
points |
An object of class |
topodata |
A data frame with topographic data for each point (i.e. three columns named |
dates |
An object of class |
export |
If |
exportDir |
Output directory for corrected meteorology. |
metadatafile |
The name of the file that will store the meta data describing all written files. |
exportFormat |
Export format for meteorological data (see |
corrOut |
Boolean flag to indicate that correction parameters (i.e. calculated biases) should be included with the output. Setting |
verbose |
Boolean flag to print process information. |
error.type |
String to specify the error to be evaluated, either |
keep.data |
Boolean flag to return the uncorrected/corrected data for the historical period. |
Function correctionpoints
performs statistical correction of predicted climatic data for all points supplied in points
whereas correctionpoint
performs statistical correction of one single point. Observed meteorological data for each point typically comes from a nearby meteorological station, but they can be the result of interpolating the meteorology of several stations (see MeteorologyInterpolationData
) or they can be extracted from reanalyzed meteorology (e.g. EU-WATCH) (see extractNetCDF
).
For each target point, correctionpoints
function first determines the predicted cell where the point falls. Then it calls correctionpoint
. In turn, correctionpoint
determines the dates that are shared in observed and predicted data for the historical period. These meteorological data of dates are used to conduct the correction of predicted climatic data for the future period. Corrections biases are calculated and applied for the twelve months separately. The user can control the methods used for correction of each meteorological variable by changing the slot params
in object
(see class MeteorologyUncorrectedData-class
) or the parameter params
to correctionpoint
. Three options are allowed (see defaultCorrectionParams
): (a) 'unbias' for shifting the mean; (b) 'scaling' for multiplication by a factor; and (c) 'quantmap' for empirical quantile mapping between observed and modelled data (Déqué 2007).
A difficulty arises for quantile mapping when the variables bounded by zero, such as precipitation. As the models tend to drizzle (or may have lower frequency of precipitation events), the probability of precipitation in the model may be greater or lower than that observed. To correct this, when model precipitation is zero an observed value is randomly chosen in the interval where the observed cumulative frequency is less than or equal to the probability of no precipitation in the model. This procedure ensures that the probability of precipitation after correction is equal to that observed (Boé 2007).
If export = FALSE
, the function correctionpoints
returns an object of class SpatialPointsMeteorology-class
with the downscaled meteorology for each point. If export=TRUE
function correctionpoints
returns an object of class SpatialPointsDataFrame-class
containing the meta data of the files written in the disk. If corrOut = TRUE
the previous structures are embedded in a list which also contains an object with the calculated correction factors (biases, mappings) for each point and month. Function correctionpoints.errors
(keep.data = FALSE
) returns a data frame with the mean absolute error (MAE) and bias for each variable and point. If keep.data = TRUE
then the function also returns a list of data frames with the uncorrected/corrected series used in the comparisons with observations.
Miquel De Cáceres Ainsa, Centre Tecnologic Forestal de Catalunya
Nicolas Martin, INRA-Avignon
Boé J, Terray L, Habets F, Martin E (2007) Statistical and dynamical downscaling of the Seine basin climate for hydro-meteorological studies. Int J Climatol 27:1643–1655. doi: 10.1002/joc.1602
De Caceres M, Martin-StPaul N, Turco M, Cabon A, Granda V (2018) Estimating daily meteorological data and downscaling climate models over landscapes. Environmental Modelling and Software 108: 186-196.
Déqué M (2007) Frequency of precipitation and temperature extremes over France in an anthropogenic scenario: Model results and statistical correction according to observed values. Glob Planet Change 57:16–26. doi: 10.1016/j.gloplacha.2006.11.030
penman
, extractNetCDF
, SpatialPointsMeteorology-class
, writemeteorologypointfiles
, MeteorologyUncorrectedData
, MeteorologyInterpolationData
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | data(examplegridtopography)
data(exampleinterpolationdata)
data(examplecorrectiondata)
#Creates spatial topography points from the grid
p = 1:2
spt = as(examplegridtopography, "SpatialPointsTopography")[p]
#Interpolation of two points for the whole time period (2000-2003)
historical = interpolationpoints(exampleinterpolationdata, spt)
#Downscaling of future predictions (RCM models, year 2023)
predicted = correctionpoints(examplecorrectiondata, historical, spt@data)
#Plot predicted mean temperature for point 1
meteoplot(predicted, 1, "MeanTemperature", ylab="Temperature (Celsius)", ylim=c(-5,40))
meteoplot(predicted, 1, "MinTemperature", add=TRUE, col="blue")
meteoplot(predicted, 1, "MaxTemperature", add=TRUE, col="red")
#Add uncorrected mean temperature data (cell #3)
lines(examplecorrectiondata@dates,
examplecorrectiondata@projection_data[[3]]$MeanTemperature,
lty=3)
lines(examplecorrectiondata@dates,
examplecorrectiondata@projection_data[[3]]$MinTemperature,
col="blue", lty=3)
lines(examplecorrectiondata@dates,
examplecorrectiondata@projection_data[[3]]$MaxTemperature,
col="red", lty=3)
legend("topright", legend=c("corrected","uncorrected", "Maximum", "Mean", "Minimum"),
col=c("black","black", "red","black","blue"), lty=c(1,3,1,1,1), bty="n")
#Scatter plot
plot(examplecorrectiondata@projection_data[[3]]$MeanTemperature,
predicted@data[[1]]$MeanTemperature, cex=0.1, asp=1,
ylab="Corrected mean temperature", xlab="Uncorrected mean temperature")
abline(a=0,b=1,col="gray")
#Plot predicted precipitation for point 1
meteoplot(predicted, 1, "Precipitation", ylab="Precipitation (mm)", ylim=c(0,120))
#Add uncorrected mean temperature data (cell #3)
lines(examplecorrectiondata@dates,
examplecorrectiondata@projection_data[[3]]$Precipitation,
col="red", lty=3)
legend("topleft", legend=c("corrected","uncorrected"), col=c("black","red"), lty=c(1,3), bty="n")
#Scatter plot
plot(examplecorrectiondata@projection_data[[3]]$Precipitation,
predicted@data[[1]]$Precipitation, cex=0.1, asp=1,
ylab="Corrected precipitation (mm)", xlab="Uncorrected precipitation (mm)")
abline(a=0,b=1,col="gray")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.