This function executes the Multi Resolution Scanning algorithm to detect differences across multiple distributions.
mrs(X, G, n_groups = length(unique(G)), Omega = "default", K = 6,
init_state = NULL, beta = 1, gamma = 0.3, delta = NULL, eta = 0.3,
alpha = 0.5, return_global_null = TRUE, return_tree = TRUE,
min_n_node = 0)
An mrs
object.
Matrix of the data. Each row represents an observation.
Numeric vector of the group label of each observation. Labels are integers starting from 1.
Number of groups.
Matrix defining the vertices of the sample space.
The "default"
option defines a hyperrectangle containing all the data points.
Otherwise the user can define a matrix where each row represents a dimension,
and the two columns contain the associated lower and upper limits for each dimension.
Depth of the tree. Default is K = 6
, while the maximum is K = 14
.
Initial state of the hidden Markov process. The three states are null, altenrative and prune, respectively.
Spatial clustering parameter of the transition probability matrix. Default is beta = 1
.
Parameter of the transition probability matrix. Default is gamma = 0.3
.
Optional parameter of the transition probability matrix. Default is delta = NULL
.
Parameter of the transition probability matrix. Default is eta = 0.3
.
Pseudo-counts of the Beta random probability assignments. Default is alpha = 0.5
.
Boolean indicating whether to return the posterior probability of the global null hypothesis.
Boolean indicating whether to return the posterior representative tree.
Node in the tree is returned if there are more than min_n_node
data-points in it.
Soriano J. and Ma L. (2017). Probabilistic multi-resolution scanning for two-sample differences. Journal of the Royal Statistical Society: Series B (Statistical Methodology). tools:::Rd_expr_doi("10.1111/rssb.12180")
set.seed(1)
n = 20
p = 2
X = matrix(c(runif(p*n/2),rbeta(p*n/2, 1, 4)), nrow=n, byrow=TRUE)
G = c(rep(1,n/2), rep(2,n/2))
ans = mrs(X=X, G=G)
Run the code above in your browser using DataLab