updated predict_fun.R. Now it is possible to to prediction more directly by passing the estimation results