i have vector cumulative distribution function, let in form
y=seq(0, 1.0, 0.05)
now need function inverse cdf of y,
f(0.1)=3
and
f(0.9)=19
any ideas how this?
the which
function this.
> y <- seq(0, 1.0, 0.05) > which(y == .1) [1] 3 > which(y == .9) [1] 19
however, if trying find inverse cdf, might have deal 2 vectors x
, y
, since possible x
take indices values. might want this.
> y <- seq(0, 1.0, 0.05) > x <- 1:21 > x[which(y == .1)] [1] 3 > x[which(y == .9)] [1] 19
Comments
Post a Comment