2006 ford f 150 speedometer jumping

I have a 2006 ford f 150 . the speedometer is not working in the morning and then is fine in the afternoon. It only jumps up and down when I reach over 40 mph ( found this out by my gps). what could be the problem??