Update functions2.R

add prediction function