From Liuren Wu so as to explain the P&L attribution: "One can perform a Taylor expansion of the option value change over a short time interval... The partial derivatives capture (risk) exposures to time decay (theta), price movement (delta), volatility movement (vega), second-order effects (gamma, vanna, volga)."
Just measure IV on a high frequency basis, meaning don't use daily numbers to calculate intraday moves. If the minimum tick size for an option is 5cts, it cannot go to 3 cts. So if it stays at 5 cts until expiry, of course IV is gonna shoot to the moon during the last couple of minutes of trading. Also remember: The expiration is not on the last trading day but on the settlement day, which - at least for options that settle on Saturday - includes a period of risk that cannot be hedged dynamically. If you set expiration date to the last trading days close, you'll always come up with IV numbers that you think are too high