Description Usage Arguments Value Examples
View source: R/predict.distmap.R
Calls a distribution mapping (distmap) object's transfer function on data. This transforms the distribution of the data such that x-distributed input will be y-distributed on output, for the x and y datasets used to construct the mapping.
1 2 |
object |
An object of class 'distmap'. |
xnew |
The data to be transformed. If omitted, object$x is used. |
... |
Additional arguments to object$transfer(), which is constructed by splinefun(). |
A vector of transformed values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(222)
obs <- rgamma(1e6, shape=2)
mod <- rweibull(1e6,shape=3, scale=3)
mod2 <- exp(rnorm(1e6, sd=0.5)+1)
map <- distmap(mod, obs)
bc <- predict(map)
bc2 <- predict(map, mod2)
plot(NA, type="n", xlim=c(0,10), ylim=c(0,0.5), main="bias-correction PDFs")
lines(density(obs), col="black", lwd=3)
lines(density(mod), col="red", lwd=2)
lines(density(bc), col="red", lwd=2, lty=2)
lines(density(mod2), col="blue", lwd=2)
lines(density(bc2), col="blue", lwd=2, lty=2)
legend("topright", c("obs","mod","bc","mod2","bc2"),
col=c("black","red","red","blue","blue"), lty=c(1,1,2,1,2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.