3d implied volatility surface
This isn't specifically financial so any follow up is perhaps better done on the general R-help list, but try demo(persp) to see some example code that's built in. If I remember correctly, demo(lattice) also has at least one 3d example. Michael On Wed, Oct 26, 2011 at 1:43 PM, financial engineer
<fin_engr at hotmail.com> wrote:
hi, I'd like to be able to plot a 3-d vol surface using option strike vs. expiration(as yrs to maturity) vs. implied volatility. I have the historical trade-date, expiration-date, strike, option price, option symbol, option type, implied vol. etc. data for each option, so I ran the following query: OpQuotes <- dbGetQuery(con,"SELECT strike,iv,ytm FROM greeks WHERE trade_date='2011-10-07' AND symbol like 'MCO%'and type='C';") I am trying to figure out if I need to convert the above into a list or have individual matrices, or set it up as a seq. Would appreciate some help/direction/suggestion/example code on that. I'd like to be able to use "persp" or "lattice" to plot this. thanks! ? ? ? ?[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.