prob2pdf | R Documentation |
prob2pdf takes a vector of probabilities and a spatial grid (given by end-points and interfaces) and computes the average p.d.f. in each grid cell
prob2pdf(phi, xgrid, ygrid = c(0, 1))
phi |
Vector of probabilities |
xgrid |
Spatial grid |
ygrid |
Optional grid in y-direction (see details) |
length(phi) must equal length(xgrid)-1, if ygrid is not given, or (length(xgrid)-1)*(length(ygrid)-1) if ygrid is given
xgrid (and ygrid, if given) must be strictly increasing
xgrid <- seq(-2,2,length=10)^3
phi <- diff(pnorm(xgrid))
f <- prob2pdf(phi,xgrid)
plot(utils::head(xgrid,-1),f,type="S")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.