[R-sig-Geo] Problems with autosearch() in deal-package

Dennis Wittenberg dwittenberg at uni-bielefeld.de
Mon Nov 28 18:06:24 CET 2005


Hello everybody,

currently I'm trying to understand the autosearch-function in the
deal-package.
I have implemented a data generating function (dat.fr) with variable
sample size T.
The two variables x and z are randomly generated. y depends on x and z.

The R-code:

dat.fr=function(T) 
{ 
u1=matrix(rnorm(T*1),T,1); 
u2=matrix(rnorm(T*1),T,1); 
u3=matrix(rnorm(T*1),T,1); 
x=u1; 
z=u2; 
a=1; 
b=2; 
y=a*x+b*z+u3; 
data.frame(x,y,z) 
} 

Applied to autosearch I expect a network x-->y<--z, no matter which
sample size is used or how often dat.fr() is renewed. 

Unfortunately, for repeated trials, autosearch provides several,
different network-outputs.
Sometimes the output is conform to the expected network, sometimes it
isn't.
I cannot determine the reason for this.

Any help with my problem would be greatly appreciated.

R-code:

df=dat.fr(100)

df.nw=network(df); 
df.prior=jointprior(df.nw,4); 
df.nw=getnetwork(learn(df.nw,df,df.prior)); 
df.search=autosearch(df.nw,df,df.prior,trace=TRUE)

Thanks and best wishes,

Dennis Wittenberg




More information about the R-sig-Geo mailing list