[R] Problem with clusterCall, "Error in checkForRemoteErrors(lapply(cl, recvResult)) : "

telm8 chienlinterry.huang at postgrad.manchester.ac.uk
Wed Aug 25 17:02:43 CEST 2010


Hi all,

I am trying to use snow package to do a parallel MCMC. I have read a few
guides and articles, the following is that I came up with.

When I run it I got the error message:
Error in checkForRemoteErrors(lapply(cl, recvResult)) : 
  4 nodes produced errors; first error: could not find function "ui.Next"

The data is a longitudinal data with few repeated readings on a number of
individuals. However, the response is organised in a vector rather than a
matrix. E.g. (y_11 , y_12 , y_13 , y_14 , y_21 , y_22 , ... , y_n1 , ... ,
y_nTn )^T

X , Z are covariates.

beta is a matrix of coefficients associated with X

C is the latent class membership indicator

sigma.sq is the diagonal elements of the covariance matrix of u, which is a
random effect parameter and the one I am trying to sample with the function.

sd is the diagonal elements of the covariance matrix of the proposal
distribution.

The following is the particular function:

ui.Full.Sample.Cluster = function( levels , Y , X , beta , Z , C , sigma.sq
, sd , burnin , iteration )
{
	cluster = makeCluster( 4 , type = "MPI");
	clusterSetupRNG( cluster );
	
	patients = unique( levels );
	
	q = length( X[1,] );
	
	u = ui.Ini( q , length( patients ) );
	
	n = levels[ length(patients) ];
	
	marker = levels == patients[1];
		
	y = Y[ marker ];
	x = X[ marker, ];
	z = Z[ marker, ];
	
	u[1,] = ui.1.Sample( u[1,] , y , x , beta , z , C[1] , sigma.sq , sd ,
burnin , iteration )$uFinal;
	
	for( i in 2:n)
	{
		marker = levels == patients[i];
		
		y = Y[ marker ];
		x = X[ marker, ];
		z = Z[ marker, ];
		
		print( i );
		
		u[i, ] = clusterCall( cluster , ui.1.Sample, u[i,] , y , x , beta , z ,
C[i] , sigma.sq , sd , burnin , iteration )$uFinal;
		
		print( i );
	}
	
	stopCluster( cluster );
	
	u;
}



If anyone could help that would be much appreciated! But big thanks for
taking your time to read the post!

TelM8
-- 
View this message in context: http://r.789695.n4.nabble.com/Problem-with-clusterCall-Error-in-checkForRemoteErrors-lapply-cl-recvResult-tp2338375p2338375.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list