Description Usage Arguments Details Examples
Given two binary (0 or 1) features, X and Y, of a set of individuals sequenced by some numerical attribute (length, say), this function performs loess smoothing on those observed features in order to the estimate the probability that each feature is 1, expressed as a function of the numerical attribute.
1 2 3 |
lengths_all |
NULL, or a vector of all lengths |
lengths_X_0 |
NULL, or a vector of lengths for which X is observed to be 0 |
lengths_X_1 |
NULL, or a vector of lengths for which X is observed to be 1 |
lengths_Y_0 |
NULL, or a vector of lengths for which Y is observed to be 0 |
lengths_Y_1 |
NULL, or a vector of lengths for which X is observed to be 1 |
monotonicity |
NULL, 'increasing' or 'decreasing'. |
The function requires four vectors, namely that of the lengths for which X = 0, X = 1, Y = 0 and Y = 1. Not all four need to be provided, as the missing ones can be inferred provided enough information: the function can accept a vector of all lengths, meaning labels with X = 0 (resp. Y = 0) can then be inferred from the list of those with X = 1 (resp. Y = 1) and vice versa.
If set to 'increasing' (resp. 'decreasing'), the monotonicity argument enforces that the resulting probabilities be monotone by setting each label probability equal to the max (resp. min) of all estimated label probabilities on a shorter length individual.
1 2 3 4 | > label_probs = loess_smoothed_marginals(1:10, lengths_X_0=c(4, 7, 8), lengths_Y_1=8:10, monotonicity='increasing')
> label_probs$X
> label_probs$Y
> label_probs$length
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.