View source: R/canonical-interface.R
| gseg1_graph | R Documentation |
Applies the single-change graph scan to a supplied edge matrix.
gseg1_graph(n, E, statistics = "m", n0 = 0.05 * n,
n1 = 0.95 * n, pval.appr = TRUE, skew.corr = TRUE,
pval.perm = FALSE, B = 100)
n |
Number of observations in the sequence. |
E |
Two-column edge matrix for the similarity graph. |
statistics |
Scan statistic or statistics; see |
n0 |
First candidate change-point location. |
n1 |
Last candidate change-point location. |
pval.appr |
Whether to calculate the analytic p-value approximation. |
skew.corr |
Whether to include its skewness correction. |
pval.perm |
Whether to calculate a permutation p-value. |
B |
Number of permutations. |
The requested statistic must have positive permutation variance at each
candidate location. Graphs for which a candidate score is undefined are
rejected rather than silently omitted. For a single candidate location,
set pval.appr = FALSE and use permutation calibration instead of
the continuous-range analytic scan approximation.
A list containing scan statistics and requested p-values.
Analytic integrations are checked for convergence and finite probability
outputs in [0,1]. An unavailable approximation raises an error rather
than returning an invalid probability. Setting pval.appr = FALSE allows
justified permutation calibration to be used instead. Scan components must be
well-defined on the requested domain; undefined components are not replaced
by zero.
gseg1, gseg_kmst
set.seed(1)
x <- matrix(rnorm(80), nrow = 20)
E <- gseg_kmst(x)
ans <- gseg1_graph(nrow(x), E, pval.appr = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.