I just got the raw historical option data that has bid and ask prices. For a same maturity/strike, there are 4 prices (call/put and bid/ask), how should we back-out the implied vol? - Get the mid price, get IV for call and IVput, average them? - Get IV for all four, and average ? - Others?
There are an infinite number of possibilities. You will have to decide for yourself. It gets a lot trickier the wider the spread and the less liquid the option. Also, put-call parity is often "violated" for very valid reasons.