simplified matrixABF in ash.R