For the RDD m1_Vbeta_inv_Sigmabeta_j_draw transformation there is need to first collect and then apply the lamdba function since the sorted cogroup-rdd is a list if collected and then we can apply the lambda of iters on it.
This also solves the error 'PipelinedRDD' object is not iterable