SimDataAffiliation {simone} | R Documentation |
Simulate a gaussian sample from a gaussian graphical network with a latent structure
SimDataAffiliation (p, n, proba.in, proba.out, alpha, proba.dust=0)
p |
Scalar : number of nodes in the graph. |
n |
Scalar : number of Gaussian samples to simulate. |
proba.in |
Scalar : graph intra-class probability of edge existence. |
proba.out |
Scalar : graph inter-class probability of edge existence. |
alpha |
Vector : prior relative probability of the graph's classes. Probabilities are internally normalized once added the dustbin probability, so as dust.proba remains unchanged and alpha sums to 1. Also defines the number of classes by its length. |
proba.dust |
Scalar : Prior probability of dustbin nodes. Default $0$. |
This function first draws node class belonging for the p
nodes using a multinomial law parametered by alpha
and
proba.dust
. The graph is then built as follows: edge existence
or absence are drawn from a mixture of binomial distributions,
parametered by proba.in
, proba.out
, proba.dust
according to the node class belonging. The edges are then set to -1 or
1 with probability 1/2 while ensuring symmetry. The obtained matrix is
normalized so as to have a "heavy diagonal" of unitary values,
ensuring inversability. This constitutes the graph's precision matrix
K.theo
. The theoretic covariance matrix Sigma.theo
is
obtained by inversing K.theo
.
A simulated data set data
is then generated as n
sample
of a Gaussian vector with covariance matrix Sigma.theo
.
Returns a List comprising :
cl.theo |
A vector of node classification |
K.theo |
A p x p precision matrix |
Sigma.theo |
A p x p covariance matrix |
data |
A n x p matrix that contains a
$n$ samples of a Gaussian vector |
C. Ambroise, J. Chiquet and A. Smith
library(simone) ## The data set parameters p <- 100 n <- 200 proba.in <- 0.25 proba.out <- 0.025 alpha <- c(0.5,0.3,0.2) # Simulate the data set X <- SimDataAffiliation (p,n,proba.in,proba.out,alpha,proba.dust=0.2) ## Plot the graph and summary the data set g <- Gplot(X$K.theo, X$cl.theo, main="A modular network") summary(X$data)