Skip to content

downscaleR:::biasCorrection1D returns same output as for training period #66

@teatree1212

Description

@teatree1212

Hi, your tools sound really helpful and the spirit of reproducibility behind them is great! I thought I give them a try, however, I run into an issue when using the bias Correction function (but maybe it is because I misunderstand something):
I am expecting the method to reduce the rainfall, while retaining a higher frequency of heavier rainfall events than if I were to simply reduce the model rainfall by the observed mean.

Instead of gridded data, I only have a vector of precipitation data. According to your publication, it should be possible to use vectors as well as gridded datasets, and I found the
function
downscaleR:::biasCorrection1D.

However, when I run it for my model and observation periods, the function returns almost exactly the same output as was put in for the test period.

the example data used in the code below is here

`# split-sample bias correction test:

load('example.RData')

reference/training period observations

o = ex.data[!is.na(ex.data$pr_ref_obs),]$pr_ref_obs

model output for reference/training period

p = ex.data[!is.na(ex.data$pr_ref_mod),]$pr_ref_mod

model output for test period

s = ex.data[!is.na(ex.data$pr_test_mod),]$pr_test_mod

eqm1 <- downscaleR:::biasCorrection1D(o = o,
p = p,
s = s,
precip = TRUE,
method = "eqm",
pr.threshold = 0.1,
extrapolation = "constant",
n.quantiles=16)

ex.data$bias_corrected<-NA
ex.data[!is.na(ex.data$pr_test_mod),]$bias_corrected<-eqm1

plot(ex.data$date,rep(NA,length(ex.data$date)),ylim=c(0,200))
lines(ex.data$date,ex.data$pr_ref_mod,col="red")
lines(ex.data$date,ex.data$pr_ref_obs,col="green")
lines(ex.data$date,ex.data$pr_test_mod,col="red")
lines(ex.data$date,ex.data$bias_corrected,lty=2)
legend("topright", legend=c("obs_training","mod_training","mod_test","bias_corr"),fill = c("green","red","red","black"))

why is black line and red line so similar?

would expect black line to be reduced, to more reflect the green line

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions