In R, I'm attempting quantile transformation using the qmap package. I have two datasets: one contains annual TWS model data spanning 1950 to 2100, and the other holds annual water elevation data from reference points between 1950 and 2022. My goal is to utilize quartile mapping to align the distribution of TWS with that of the water elevation.

Here are the datasets' formats:

TWS data (tws, 1950 to 2100):

      year      tws
1   1950      1798.471
2   1951      1799.204
3   1952      1801.979
4   1953      1800.762
5   1954      1804.323
6   1955      1799.403
7   1956      1796.372
8   1957      1797.438

Water elevation (wElevation, 1950 to 2022):

    year      welevation
1   1950     -0.288574
2   1951      0.461426
3   1952      1.561520
4   1953      3.161620
5   1954      2.828610
6   1955      3.011720
7   1956      2.861820

It's worth noting that many values in the water elevation dataset are negative due to their elevation from the reference point.

I'm attempting quantile transformation using the qmap package in R as shown below:

# Subset TWS data
tws_sub <- subset(tws, year < 2023)

qm.fit <- fitQmap(wElevation[,2], tws_sub[,2], method = "QUANT", qstep = 0.01)

qm.t <- doQmap(tws[,2], qm.fit, type = "linear")

However, the resulting qm.t values are unexpected, containing numerous zero values and none are negative. I suspect I made an error somewhere but cannot pinpoint it or qmap does not deal with negative values. Is it possible to perform qmap for quantile mapping when dealing with numerous negative values? Thank you in advance for your support!

0

There are 0 best solutions below