View source: R/hypervolume_estimate_probability.R

hypervolume_estimate_probability | R Documentation |

Estimates probability density at one or more of points within or outside a hypervolume. The estimation is carried out as the weighted sum of the probability density of all subsampled random points in the input hypervolume, where the weights are proportional to the distance from the test point raised to a certain power. The default power, -1, corresponds to inverse distance weighting.

```
hypervolume_estimate_probability(hv, points,
reduction.factor = 1, weight.exponent = -1,
set.edges.zero = TRUE, edges.zero.distance.factor = 1,
parallel = FALSE, n.cores = 1,
verbose = TRUE, ...)
```

`hv` |
An input hypervolume |

`points` |
A m x n matrix of m points of dimensionality n (same as the input hypervolume). These are the points at which the probability is to be estimated. |

`reduction.factor` |
A value between 0 and 1 corresponding to a thinning factor applied to random points of the input hypervolume. Smaller values result in faster runtimes but lower accuracy. |

`weight.exponent` |
The exponent of the distance weights. Should be negative and probably does not need to be changed. |

`set.edges.zero` |
If |

`edges.zero.distance.factor` |
Positive number used to multiply the critical distance for |

`parallel` |
If |

`n.cores` |
Number of cores to use in parallel operation. |

`verbose` |
If |

`...` |
Other arguments to be passed to |

Identifies the uniformly random points enclosed within a hypersphere centered on the point of interest, then averages the probability density at each of these points.

A vector of probability densities of length corresponding to m, the number of input points.

`hypervolume_inclusion_test`

, `hypervolume_redundancy`

```
data(penguins,package='palmerpenguins')
penguins_no_na = as.data.frame(na.omit(penguins))
penguins_adelie = penguins_no_na[penguins_no_na$species=="Adelie",
c("bill_length_mm","bill_depth_mm","flipper_length_mm")]
hv = hypervolume_box(penguins_adelie,name='Adelie')
new_points = data.frame(bill_length_mm=c(0,38), bill_depth_mm=c(0,18),flipper_length_mm=c(0,190))
probs <- hypervolume_estimate_probability(hv, points=new_points)
probs
# should give a zero value and a non-zero value
# example for parallel operation
# probs_new <- hypervolume_estimate_probability(hv, points=new_points, parallel=TRUE, n.cores=2)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.