Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
teatree1212 opened this issue Sep 24, 2019 · 2 comments

Comments

@teatree1212
Copy link

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

`

@teatree1212
Copy link
Author

whopsi, sorry, the code got turned into markdown.. simply disregard the large headings (originally comments)

@Messi0617
Copy link

I have also encountered this problem. How did you solve it? I am very looking forward to your answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants