otgrid | R Documentation |
Create an object that represents a probability measure that is supported on a two-dimensional grid.
otgrid( mass, x = NULL, y = NULL, sorted = FALSE, normalize = FALSE, remove.zeros = FALSE )
mass |
matrix of non-negative weights. |
x |
vector of support points of the first marginal. |
y |
vector of support points of the second marginal. |
sorted |
logical value specifying whether or not the support points are sorted. |
normalize |
logical value specifying whether or not the total mass should be rescaled to 1. |
remove.zeros |
logical value specifying whether or not marginals with no mass should be removed from the grid. |
If x
and y
are not specified, then a equispaced unit grid is chosen.
object of class "otgrid"
. It contains the following elements:
x | vector of support points of the first marginal |
y | vector of support points of the second marginal |
n | number of support points of the first marginal |
m | number of support points of the second marginal |
mass | matrix of non-negative weights |
total | total mass |
Also note that the functions print
and plot
are available for objects of class "otgrid"
.
plot plot.otgrid
x <- otgrid(cbind(1:2, 0, 3:4), remove.zeros = TRUE) print(x) # note that it's only 2 x 2 plot(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.