set ridx in meanfieldupdate