PKG <- "copula"
citHeader(paste("To cite the R package ",PKG," in publications use:"))

if(!exists("meta") || is.null(meta)) meta <- packageDescription(PKG)
stopifnot(meta$Package == PKG)
## Careful, our 'Date:' may contain only something like $Date$, or the full
if(grepl("^\\$", mDate <- meta$Date))## $Date: 2012-10-24 14:56:42 +0200 (Wed, 24. Oct 2012) $
    mDate <- sub(" .*", '', sub(".*Date: *", '', mDate))
## when MM forgot (and mDate is "$Date"):
if(!grepl("20", mDate)) mDate <- sub(".* 20", "20", meta$Built)
year <- sub("-.*", "", mDate)
note <- sprintf("R package version %s", meta$Version)
if(getRversion() < "2.15") paste0 <- function(...) paste(..., sep="")
url <- paste0("https://CRAN.R-project.org/package=", PKG)

bibentry(bibtype = "Manual",
         title = "copula: Multivariate Dependence with Copulas",
         author = c(person(given = "Marius", family = "Hofert",
                           email = "marius.hofert@uwaterloo.ca"),
                    person(given = "Ivan", family = "Kojadinovic",
                           email = "ivan.kojadinovic@univ-pau.fr"),
                    person(given = "Martin", family = "Maechler",
                           email = "maechler@stat.math.ethz.ch"),
                    person(given = "Jun", family = "Yan",
                           email = "jun.yan@uconn.edu")),
         year = year,
         note = note,
         url = url,
         textVersion =
         paste("Marius Hofert, Ivan Kojadinovic, Martin Maechler and Jun Yan",
               sprintf("(%s).", year),
               "copula: Multivariate Dependence with Copulas.",
               note, "URL", url))


url1 <- "http://www.jstatsoft.org/v21/i04/"
bibentry(bibtype = "Article",
         title        = "Enjoy the Joy of Copulas: With a Package {copula}",
         author       = person("Jun Yan"),
         journal      = "Journal of Statistical Software",
         year         = "2007",
         volume       = "21",
         number       = "4",
         pages        = "1--21",
         url          = url1,
         textVersion  =
         paste0("Jun Yan (2007). ",
                "Enjoy the Joy of Copulas: With a Package copula. ",
                "Journal of Statistical Software, 21(4), 1-21. ", "URL", url1, "."))


bibentry(bibtype = "Article",
  title        = "Modeling Multivariate Distributions with Continuous Margins Using the {copula} {R} Package",
  author       = c(person("Ivan Kojadinovic"),
                   person("Jun Yan")),
  journal      = "Journal of Statistical Software",
  year         = "2010",
  volume       = "34",
  number       = "9",
  pages        = "1--20",
  url          = "http://www.jstatsoft.org/v34/i09/",
  textVersion  =
  paste("Ivan Kojadinovic, Jun Yan (2010).",
        "Modeling Multivariate Distributions with Continuous Margins Using the copula R Package.",
        "Journal of Statistical Software, 34(9), 1-20.",
        "URL http://www.jstatsoft.org/v34/i09/.")
)

bibentry(bibtype = "Article",
  title        = "Nested Archimedean Copulas Meet {R}: The {nacopula} Package",
  author       = c(person("Marius Hofert"),
                   person("Martin M\\\"achler")),
  journal      = "Journal of Statistical Software",
  year         = "2011",
  volume       = "39",
  number       = "9",
  pages        = "1--20",
  url          = "http://www.jstatsoft.org/v39/i09/",

  textVersion  =
  paste("Marius Hofert, Martin Maechler (2011).",
        "Nested Archimedean Copulas Meet R: The nacopula Package.",
        "Journal of Statistical Software, 39(9), 1-20.",
        "URL http://www.jstatsoft.org/v39/i09/.")
)

