created function to compute SE for GAM object