Estimate fog formation from temperature and dew point.
Fog forms when air cools to its dew point, so the spread between temperature and dew point is the single best predictor: below about 2 C fog becomes plausible and below 1 C it is likely overnight. Light wind is required — calm air allows radiative cooling while wind above roughly 16 km/h mixes the layer and prevents it — and clear skies accelerate the cooling that closes the gap.
Dew point spread and fog likelihood
Spread = air temperature - dew point; relative humidity = 100 x exp(gamma(dew) - gamma(temp)) where gamma(T) = 17.27 T / (T + 237.3); likelihood combines spread, wind and sky cover
Radiation fog typically forms once the spread falls below about 2 C, and is very likely under 1 C with light wind and clear skies.
Completely still air often produces only dew or shallow ground fog; a light breeze of a few km/h mixes the cooled layer just enough to deepen the fog.
Solar heating raises the air temperature above the dew point, widening the spread. Deep winter fog can persist all day when the sun is too weak to do that.