##-*- org -*-->  Emacs .. [Tab] key + [Org] menu; C-c C-o to follow links
* Very Short Term
** DONE fitCopula() for 2-dim tCopula() *AND* 2-dim  tevCopula();  latter clearly fails

** TODO mvdc() -- fitMvdc() and generate data from fit -- currently wrong on help page;
 - see FIXMEs in R/fitMvdc.R  man/fitMvdc.Rd and man/fitCopula-class.Rd -- think of
   class slots etc.
** DONE rPosStable() is wrong --> use rstable1() [unless options(..) for back compatibility]
** DONE no longer try() in loglikCopula()
   MM: "hideWarnings" seems "wrong by design", notably there.
** TODO try() in loglikMvdc()
   MM+MH: may be differently *report* reports in loglikMvdc() [margins: *their* errors].

* Short Term
** DONE persp(), contour() should work with pCopula / dCopula
** DONE getAcop(gumbelCopula()) should work
 => we could then write general methods for all Archimedean objects.
Possible problem (for now): negative concordance case for AMH, Clayton, and Frank
** DONE (MH) LICENCE etc
CLOSED: [2012-07-17 Tue 11:25]
MM: Einstein's rule: Keep it as simple as possible (but not simpler)
All the Copyright headers in R/*.R  src/*.c etc need to be streamlined;
typically containing all 4 names.
MH: I can do that (once Ivan and Jun agree)
JY: I agree
IK: Me too
=> MH: done on 2012-03-25 (for simplicity, I used "2012" everywhere)
** TODO Renaming of current "base" functions see [[file:feature-table.org][Feature table]] and [[file:do-now.org][do-now table]]
    remaining: lambdaL/U
** TODO Rebuild R-forge structure nacopula -> copula
** DONE show(<mvdc>) method needed; otherwise printing mvdc(.) looks ugly.
** TODO Deprecation of Old Stuff /  towards more consistency / Cleanup
- with warning
- on help pages
*** TODO NAC Archimedean families <--> archmCopula  unification
- The NAC Archimedean families are partly 'better' and partly "worse" than
  archmCop: need 'uscore'
- Write testing code that compares the two classes numerically.
**** TODO (MM): Make  pcopula(<archm>) and dcopula(<archm>)
 use the the numerically good formulae rather than the "exprDist".
**** TODO d=2 is special: allows negative tau, MH-code now does partly.
 done for Clayton, Frank, AMH.  BUT not for the R/cop_objects.R slots
*** TODO "copula" class:  slot re-definitions
**** DONE 'message' --> 'fullname'
**** TODO 'param.lowbnd' / 'param.upbnd' --- use "interval" as in nacopula
*** TODO nparam() "wrapper" for  length(.@parameters)
*** TODO dTau() = tau'() and dRho() = rho'() -- to get S.Err. for  "itau" and "irho"
**** TODO these are *one* of the things where IJ-archmCopula' are better
*** TODO dAduGalambos() and similar: Use  list() instead of data.frame() as return value  (?)
** TODO MM: former nacopula  c_longNames etc  --> rename to .ac_longNames *and* export
(ac = Archimedean copula)
** TODO Exporting a bit more of hidden internal functions:
*** JY: Ivan, I think we should export an empCopula function. I always
thought it was unnecessary because it can be obtained with R package mecdf.
But people have asked for it.
*** MM: Also, look at ./man/copula-internal.Rd :
**** schlatherCopula:  JY: The implementation of schlatherCopula is not ready for release.
 More ev copulas will come from max-stable processes.
**** asymCopula (-class) -- *.Rd document properly (incl some examples)
** DONE New(?) (Super)classes for "merging the class structure"
- new class "Copula" := {copula, nacopula}
** DONE C code
*** DONE [src/init.c] enable registration for the old 'copula' part
*** DONE JY: gsl - Debye ===> Should use them and then *not* carry gsl-source code anymore.
*** DONE IK: in all *.c files from former copula: use Doxygen
instead of hand made function header documentation.

** TODO Miscellaneous Functions (bugs etc)
*** DONE (MH) rtrafo() {and probably htrafo()} --- "fail" (are *wrong*!) for n = 1
*** DONE (MH) copFrank@psi(1/1e20, theta=200) == Inf instead of 1

*** TODO see TODO in  R/tCopula.R :  ndim() utility function; test pos.def.
*** TODO tCopula() / normalCopula() allow alternative specification of cor.matrix
   at least for the "un" dispersion structure
*** TODO opower() and GIG --> either produce acopula with parameter *vector*, or
--- maybe in any case ---
produce an object of class 'opacopula' ("outer power Archimedean copula")
which is just 'acopula' with a new show method ("thetabase" at least!),
possibly a new slot ...
Longer term: want to *estimate* those correctly [MLE at least].
*** TODO rtrafo() is now "available" for "t" and "normal"
thanks to the Master thesis of Yongsheng Wang.  (--> ...../function-gof.R )
**** DONE implement it,
**** TODO write a better wrapper for  gnacopula()/gofCopula()
**** TODO Extend  rtrafo() to other (d > 2)-copula families

** TODO New Wrapper functions or rather extending one or the other function names
*** TODO distribution/density/ ... functions
**** DONE dcopula(), pcopula(), rcopula()  (for "nacopula")
**** DONE dCopula(x, cop), pCopula(x, cop), rCopula(n, cop)  {swapping args for "standard R" usage}
**** DONE d*():  allow  log=TRUE and use that in loglikCopula()
**** fitCopula() should encompass all methods of enacopula()

*** TODO MMMH: Use new rCopula() in ggraph *instead* of wrappers



* Mid Term

** DONE R/sysdata.rda:
CLOSED: [2012-07-17 Tue 11:10]
MM, MH: Please tell us more about this,
notably about how it is computed {so it can be recomputed, in case
pspline changes ...}.
JY: Sorry for having to use this. The objects stored here are used to
return Kendall's tau and Spearman's rho and their inverse functions
for copulas for which explicit formulas are not available. We used
simulation over a grid of (possibly transformed) parameter values
and smoothed the results with pspline. Some details can be found
in the appendix of Kojadinovic and Yan (2010, IME). The R scripts
that generated sysdata.rda were moved out of the package source.
We can put them back. The best place is under inst?
=> JY: done on 2012-07-12. The R scripts are under inst/docs/tauRho/.
***  R code for inspection:
 attach("~/R/Pkgs/copula/R/sysdata.rda")
 ls.str(pos=2, all=TRUE)
 ## or even
 print(ls.str(pos=2, all=TRUE), max.level = 3)

** TODO Deprecation of Old Stuff / more consistency / Cleanup
*** TODO loglikCopula() --- try(), hidemessages should "go" eventually
*** TODO varPL(): TODO's there
*** TODO dTau() = tau'() and dRho() = rho'() -- to get S.Err. for  "itau" and "irho"
these are *one* of the things where IJ-archmCopula' are better
*** TODO dCdthetaEvCopula() cannot work (as dAdtheta() has no methods) and is used nowhere
** TODO rCopula() for archmCopula's should allow to use MH's racopula()
*but* for back compatibility allow *global* options(....) to still get old
random numbers.
** TODO C code
*** DONE [src/init.c] enable registration for the old 'copula' part
*** TODO use 'static' "everywhere" +  attribute_hidden "otherwise"/sometimes
** TODO Documentation etc
*** DONE inst/doc/nacopula-pkg.Rnw  -- keep file name, maybe rewrite including
 *Title*  (s/nacopula package/Nested Archimedean Copulas in the copula package/)
*** TODO \link{} between  old-copula and old-nacopula  functionality
*** TODO small vignette with table of function names providing the same functionality (nacopula / old_copula)
*** DONE (MH) fixed long lines in all .Rd
** TODO pCopula() should also accept a  'log.p = FALSE' argument and provide more accurate log.p=TRUE.

** TODO Miscellaneous functions
*** TODO iTau(): must use tau.checker() [R/estimation.R]
*** TODO MM, MH: indepTest()  takes a while {ok}, *BUT* cannot be interrupted (quickly enough)
    - shouldn't it {and all other tests} return a (valid) object of class
    "htest" (maybe "htest" in addition to the specific S3 class)?
    --> we would probably not need extra print() methods, and just use print.htest()
*** DONE MH: @ Jun, Ivan: file R/E.R  only defines E <- exp(1). Reason(MM): work around silly 'CMD check' warnings.
But we should move that to another R/*.R

*** TODO makeposdef() -- think of using a version of sfsmisc::posdefify()
*** TODO t / normal : allow  "block" dispersion structure {including  fitCopula() working}

**** --> e-mail and example: /u/maechler/R/MM/Pkg-ex/copula/mvdc-ex.R

*** TODO function(outer_nacopula) -> matrix of 'comp' (in {1:d})
which corresponds to the different sectors.
This can be used, e.g., for building a [default] color-matrix for splom2 or
for estimation purposes etc. Note: look at nacPairthetas
*** TODO nice little function that provides confidence intervals for tau and lambda's (from \theta_{MLE})
*** TODO IK: d-dimensional versions of rank-based estimators of the Pickands dependence function
*** DONE setTheta(): write methods for "copula"s !
** TODO Testing: ./tests/  must grow, notably for "Jun-Ivan functions"
maybe take  ./tests/copula-play.R  as sophisticated role model.
** TODO Programming Style (unification)
*** TODO *naming* function arguments after 2nd or 3rd:
- call functions like f(x, foo=1, bar=2) instead of f(x, 1, 2).
  This makes the code more readable and more error-prone (naming all
  arguments except the first one).

** TODO Use  paste0()  where possible in IJ-code
** TODO Replace ccop in ggraph by cCopula

** DONE cacopula(): generalize to elliptical ("and more") -> cCopula(), (<==> rtrafo())

* Long Term
** TODO ChiPlot(), KPlot() [in R/graphics.R]: Export and document ?
** TODO copula code which is not used --- moved to ./misc/
MM: the previous file (+directory) names were:
    - R/mult.R
    - src/mult.c
    - src/mygsl_util.c
** TODO C code
*** DONE [src/init.c] enable registration for the old 'copula' part
*** TODO Move  from .C() towards .Call() -- only very long term
JY: Agree. Quite a few them. Can it wait?  MM: Definitely; Actually, I
think it's not worth the effort; particularly now that I've spent all the
effort writing src/init.c for registration of all of the .C(..) routines.

** TODO Miscellaneous functions.
*** TODO include pairwise estimators for nACs
*** TODO add an ASCII-plot for the hierarchical structure;
Actually, define setAs("nacopula", "dendrogram", ....) and then use
dendrogram print()ing.
*** TODO Khoudraji d + p + r (see asymCopula.R)
*** TODO IK: add d-dimensional EV copulas corresponding to max-stable processes and corresponding "composite densities"
