How to calculate the implied volatility using the binomial options pricing model

I want to calculate IV for american options with dividends. So far I have found algorithms to calculate the option price given a volatility.

Please can you point me to paper or implementation (R, python or any other language) of an algorithm that can calculate the IV given option prices, risk free rate, dividends, etc.

-
There is a misunderstanding of such 'pricing' models that is even very prevalent here at QFbeta: BS, binomial models,... are not really pricing models, they are translation models between price <-> volatility. The price is volatility and that price is determined in the market through supply and demand. It is not that option prices are bought and sold but in reality volatility is bid and offered. So if you truly look for a model that models volatility then you need to dig a lot deeper than a simple binomial model (even the whole garch family does not add much value). –  Matt Wolf Jun 15 '13 at 13:36
Thanks Matt for your perspective. But this question is more practical rather than philosophical. In your terms, what I'm looking for is the inverse function of price = f(volatility) for the Ross-Cox-Rubinstein aka binomial model. –  Victor P Jun 15 '13 at 14:23

Here is a paper by the infamous Mark Rubinstein that should get you started.

http://www.haas.berkeley.edu/groups/finance/WP/rpf232.pdf

And here the trinomial tree version:

http://www.ederman.com/new/docs/gs-implied_trinomial_trees.pdf by no lesser than Derman and Kani.

This may also help with the actual computations:

http://sfb649.wiwi.hu-berlin.de/papers/pdf/SFB649DP2008-044.pdf

-

You don't need an algorithm to solve that - just program a simple BS option calculator using standard BS with dividend in Excel and fix all the inputs except the volatility. Then use goal seek/solver to change the volatility to get the given price and as a result you will have the implied volatility of the price.

-
Making BS assumptions to derive volatility from prices when the underlying translation tool was specified as binomial does not sound right to me unless I am missing something. –  Matt Wolf Jun 16 '13 at 0:17
Indeed..however the approach should be the similar. Just set up the binomial tree and fix all the other inputs. The change of volatility should only affect 2 the up move and down move (at least in my CRR model). But I guess Veeken already solved it more beautifully. –  Olorun Jun 16 '13 at 9:08
The approach is not similar. You can't push prices from a Binomial model through a BS pricer and say the resulting volatilities are the price equivalent from the Binomial model. –  Matt Wolf Jun 16 '13 at 12:11
yeah...i just stopped by before sleeping and clearly i didnt appreciate that indeed he may be looking for a local vol structure. but if he's not, and wants to assume $\sigma$ is constant, i fail to see how what i describe above won't work. –  Veeken Jun 16 '13 at 13:37