isos_simulations: simulations for isoscape

Description Usage Arguments Details Value Functions

View source: R/isos_simulations.R

Description

Functions to compute probability of origins to a given sample.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
isos_simulations(ls_values, sample_size, ls_density, nrep)

isos_simulations_mixture2(
  ls_values,
  sample_size,
  ls_density,
  dens1,
  dens2,
  perc,
  nrep
)

isos_sample(sample, ls_density)

isos_likelihood(sample, density)

Arguments

ls_values

List of values to be sampled.

sample_size

size of the samples to be drawn.

ls_density

a list of object of class stats::density().

nrep

an integer indicating the number of repetition (see details section).

dens1, dens2

an integer that identities the first (and second) distribution to be mixed (in ls_density).

perc

a vector of numeric indicating the percentage of dens1 included in the sample (assuming the remaining is made of dens2).

sample

values of a sample.

density

an object of class stats::density().

Details

For every density included in ls_density the likelihood that the sample is coming from a specific region is computed. Then likelihood values are compared to determine the probability for sample of having been drawn from the density (there is a reason why the ratio work). Probability for all densities are returned and the corresponding vector is ordered following ls_density.

Value

A matrix

A vector of probabilities.

A vector of probabilities of origin for every distribution in ls_density.

A likelihood value.

Functions


McCannLab/spatial_fingerprints documentation built on March 13, 2021, 12:02 a.m.