{"id":655,"date":"2014-07-15T09:43:44","date_gmt":"2014-07-15T16:43:44","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=655"},"modified":"2014-07-15T09:43:44","modified_gmt":"2014-07-15T16:43:44","slug":"visualize-copulas","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2014\/07\/15\/visualize-copulas\/","title":{"rendered":"Visualize Copulas"},"content":{"rendered":"<p><span style=\"color: #444444;\">In those\u00a0<\/span><a style=\"color: #205b87;\" href=\"http:\/\/www.mathfinance.cn\/tags\/copula\/\" target=\"_blank\" rel=\"noopener\">Copula codes<\/a><span style=\"color: #444444;\">\u00a0you can get a rough idea what copula is, how to estimate and simulate it, how to test its performance, etc., to help you visualize what on earth the copula should look like, below R code draws plots of some widely used copulas.<\/span><br style=\"color: #444444;\" \/><br style=\"color: #444444;\" \/><a style=\"color: #205b87;\" href=\"http:\/\/www.math.tu-berlin.de\/~mkeller\/index.php?target=rcode\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.math.tu-berlin.de\/~mkeller\/index.php?target=rcode<\/a><\/p>\n<h2 style=\"color: #666666;\">R code<\/h2>\n<p><span style=\"color: #000000;\">Programs I wrote for the statistical computing environment\u00a0<\/span><a style=\"color: #669999;\" href=\"http:\/\/www.r-project.org\/\">R<\/a><span style=\"color: #000000;\">.\u00a0<\/span><b style=\"color: #000000;\">Note that I am no longer actively maintaining the code.<\/b><\/p>\n<h3 style=\"color: #666666;\">Download Option Data and Plot Smiles<\/h3>\n<p style=\"color: #000000;\"><a style=\"color: #669999;\" href=\"http:\/\/page.math.tu-berlin.de\/~mkeller\/R-progs\/yahoo_opt.R\">yahoo_opt.R<\/a><\/p>\n<p style=\"color: #000000;\">This R program can be used to download option price data from Yahoo to a data frame and to plot the corresponding implied-volatility smiles. Requires package &#8216;fCalendar&#8217;. After downloading and sourcing the file try the following lines of code:<\/p>\n<pre style=\"color: #000000;\"><code>\nopt &lt;- yahoo.getAllOptions(\"IBM\") ## download data\nsummary(opt)                      ## data overview\nplot.smile(opt)                   ## plot 2d volatility smiles\nplot3d.smile(opt)                 ## plot 3d volatility smiles\n<\/code><\/pre>\n<p style=\"color: #000000;\">\n<h3 style=\"color: #666666;\">Visualize Levy Processes<\/h3>\n<p style=\"color: #000000;\"><a style=\"color: #669999;\" href=\"http:\/\/page.math.tu-berlin.de\/~mkeller\/R-progs\/levy_proc.R\">levy_proc.R<\/a><\/p>\n<p style=\"color: #000000;\">This R program contains functions to plot trajectories of several Levy processes. The processes implemented are alpha-stable processes, Variance-Gamma and Normal-Inverse-Gaussian processes. Requires packages &#8216;SuppDists&#8217; and &#8216;fBasics&#8217;. After downloading and sourcing the file try the following lines of code:<\/p>\n<pre style=\"color: #000000;\"><code>\nplot.multi(stable.proc,alpha=1.7,beta=1)         ## Stable process\nplot.multi(VG.proc,sigma=0.2,theta=1,kappa=0.1)  ## Variance Gamma process with drift\nplot.multi(NIG.proc,sigma=0.2,theta=0,kappa=0.1) ## Normal Inverse Gaussian process\n<\/code><\/pre>\n<p style=\"color: #000000;\">\n<h3 style=\"color: #666666;\">Visualize Some Copulas<\/h3>\n<p style=\"color: #000000;\"><a style=\"color: #669999;\" href=\"http:\/\/page.math.tu-berlin.de\/~mkeller\/R-progs\/copula.R\">copula.R<\/a><\/p>\n<p style=\"color: #000000;\">This R program draws some plots of frequently used copulas. Just execute the R-code directly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In those\u00a0Copula codes\u00a0you can get a rough idea what copula is, how to estimate and simulate it, how to test its performance, etc., to help&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-655","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=655"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/655\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}