A Bayesian method for genomic prediction and association study