Lewis Hamilton is to leave McLaren and drive for Mercedes next season, BBC Formula 1 chief analyst Eddie Jordan understands.