Description Usage Arguments Value Examples
simulGBN simulates data from a GBN.
1 |
N |
integer - Number of observations to simulate. |
m |
vector - Mean of the simulation law. Must be the of the same dimension as s and columns of W. |
s |
vector - Variance of the simulation law. Must be the of the same dimension as m and columns of W. |
W |
matrix - Weightmatrix of the GBNetwork. |
int |
integer or vector of integers - Columns of the simulated data mentionned in int will have the corresponding value of int_data. |
int_data |
vector - Values of the columns mentionned in int. |
seed |
integer - The function simulate the data according to the seed. |
The function return a matrix of the simulated data : the number of rows is N and the number of columns is equal to the dimension of W.
1 2 3 4 5 6 7 8 9 10 11 | # Simulate data from a GBN with intervention on nodes 1 and 9.
p<-10
W1=1*upper.tri(matrix(0,p,p))
m1=rep(0,10)
sigma1=rep(0.1,10)
X=simulGBN(2*p,m1,sigma1,W1,seed = 1990)
X=rbind(X,simulGBN(p,m1,sigma1,W1,int=1,int_data=0,seed = 1990))
X=rbind(X,simulGBN(p,m1,sigma1,W1,int=9,int_data=0,seed = 1990))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.