Getting started with the PCMBaseCpp R-package

2020-03-23

How to use the package?

There are two ways to use PCMBaseCpp:

Passing the function PCMInfoCpp as a metaI argument of PCMLik and/or PCMCreateLikelihood

## Loading required package: Rcpp
##    user  system elapsed 
##   0.088   0.002   0.091
##    user  system elapsed 
##   0.004   0.000   0.004
## [1] -206.4146
## attr(,"X0")
## [1] 5 2 1
## [1] -206.4146
## attr(,"X0")
## [1] 5 2 1
##    user  system elapsed 
##   0.069   0.000   0.069
##    user  system elapsed 
##   0.002   0.000   0.002
##    user  system elapsed 
##   0.002   0.000   0.002
## [1] -598.092
## attr(,"X0")
## [1] -4.689827 -2.557522  1.457067
## [1] -598.092
## attr(,"X0")
## [1] -4.689827 -2.557522  1.457067
## [1] -598.092
## attr(,"X0")
## [1] -4.689827 -2.557522  1.457067

Passing the meta-information object returned by PCMInfoCpp as a metaI argument of PCMLik and PCMCreateLikelihood

This is the recommended usage in the case of multiple likelihood evaluations, e.g. during model inference:

##    user  system elapsed 
##    0.07    0.00    0.07
##    user  system elapsed 
##   0.002   0.000   0.001
## [1] -206.4146
## attr(,"X0")
## [1] 5 2 1
## [1] -206.4146
## attr(,"X0")
## [1] 5 2 1
##    user  system elapsed 
##   0.069   0.000   0.068
##    user  system elapsed 
##   0.002   0.000   0.001
## [1] -206.4146
## attr(,"X0")
## [1] 5 2 1
## [1] -206.4146
## attr(,"X0")
## [1] 5 2 1