Skip to content

Commit

Permalink
translated the c code to c++
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiosg committed Aug 22, 2024
1 parent 2fa548c commit 327a184
Show file tree
Hide file tree
Showing 78 changed files with 1,980 additions and 1,239 deletions.
Empty file modified .Rbuildignore
100644 → 100755
Empty file.
Empty file modified .github/.gitignore
100644 → 100755
Empty file.
Empty file modified .github/workflows/R-CMD-check.yaml
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ vignettes/*.pdf
*.o
*.so
*.Rproj
tests/.DS_Store
src/TMB/.DS_Store
src/.DS_Store
.github/.DS_Store
.DS_Store
8 changes: 4 additions & 4 deletions DESCRIPTION
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Package: tsdistributions
Type: Package
Title: Location Scale Standardized Distributions
Version: 1.0.1
Version: 1.0.2
Authors@R: c(person("Alexios", "Galanos", role = c("aut", "cre","cph"), email = "alexios@4dscape.com"))
Maintainer: Alexios Galanos <alexios@4dscape.com>
Depends: R (>= 3.5.0), methods, tsmethods
LinkingTo: TMB, RcppEigen
Imports: TMB (>= 1.7.20), Rdpack, GeneralizedHyperbolic, KernSmooth, SkewHyperbolic, mev, stats, utils, data.table, zoo, Rsolnp, sandwich, future.apply, future, progressr
LinkingTo: Rcpp, TMB, RcppEigen
Imports: Rcpp, TMB (>= 1.7.20), Rdpack, GeneralizedHyperbolic, KernSmooth, SkewHyperbolic, mev, stats, utils, data.table, zoo, Rsolnp, sandwich, future.apply, future, progressr
Description: Location-Scale based distributions parameterized in terms of mean, standard deviation, skew and shape parameters and estimation using automatic differentiation. Distributions include the Normal, Student and GED as well as their skewed variants ('Fernandez and Steel'), the 'Johnson SU', and the Generalized Hyperbolic. Also included is the semi-parametric piece wise distribution ('spd') with Pareto tails and kernel interior.
License: GPL-2
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
VignetteBuilder: knitr
RdMacros: Rdpack
URL: https://www.nopredict.com/packages/tsdistributions, https://github.com/tsmodels/tsdistributions
Expand Down
7 changes: 6 additions & 1 deletion NAMESPACE
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export(ddist)
export(dged)
export(dgh)
export(dghst)
export(dghyp)
export(distribution_bounds)
export(distribution_modelspec)
export(djsu)
Expand All @@ -45,6 +46,7 @@ export(pdist)
export(pged)
export(pgh)
export(pghst)
export(pghyp)
export(pjsu)
export(pnig)
export(psged)
Expand All @@ -56,6 +58,7 @@ export(qdist)
export(qged)
export(qgh)
export(qghst)
export(qghyp)
export(qjsu)
export(qnig)
export(qsged)
Expand All @@ -67,6 +70,7 @@ export(rdist)
export(rged)
export(rgh)
export(rghst)
export(rghyp)
export(rjsu)
export(rnig)
export(rsged)
Expand All @@ -79,8 +83,9 @@ import(data.table)
import(methods)
import(tsmethods)
importFrom(GeneralizedHyperbolic,ghypMom)
importFrom(GeneralizedHyperbolic,rghyp)
importFrom(KernSmooth,bkde)
importFrom(Rcpp,evalCpp)
importFrom(Rcpp,sourceCpp)
importFrom(Rdpack,reprompt)
importFrom(Rsolnp,solnp)
importFrom(SkewHyperbolic,pskewhyp)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# tsdistributions 1.0.2

* Replaced PI with M_PI to pass strict header checks
* Translated the distribution.c c functions to Rcpp.


# tsdistributions 1.0.1

* Added the semi-parametric piece-wise distribution (`spd`). As this is a special
Expand Down
127 changes: 127 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

c_dghst <- function(x, mu, sigma, skew, shape, logr) {
.Call(`_tsdistributions_c_dghst`, x, mu, sigma, skew, shape, logr)
}

c_rghst <- function(n, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_rghst`, n, mu, sigma, skew, shape)
}

c_dghyp <- function(x, alpha, beta, delta, mu, lambda, logr) {
.Call(`_tsdistributions_c_dghyp`, x, alpha, beta, delta, mu, lambda, logr)
}

c_dgh <- function(x, mu, sigma, skew, shape, lambda, logr) {
.Call(`_tsdistributions_c_dgh`, x, mu, sigma, skew, shape, lambda, logr)
}

c_dnig <- function(x, mu, sigma, skew, shape, logr) {
.Call(`_tsdistributions_c_dnig`, x, mu, sigma, skew, shape, logr)
}

c_rstd <- function(n, mu, sigma, shape) {
.Call(`_tsdistributions_c_rstd`, n, mu, sigma, shape)
}

c_dstd <- function(x, mu, sigma, shape, logr) {
.Call(`_tsdistributions_c_dstd`, x, mu, sigma, shape, logr)
}

c_pstd <- function(q, mu, sigma, shape) {
.Call(`_tsdistributions_c_pstd`, q, mu, sigma, shape)
}

c_qstd <- function(p, mu, sigma, shape) {
.Call(`_tsdistributions_c_qstd`, p, mu, sigma, shape)
}

c_rsstd <- function(n, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_rsstd`, n, mu, sigma, skew, shape)
}

c_dsstd <- function(x, mu, sigma, skew, shape, logr) {
.Call(`_tsdistributions_c_dsstd`, x, mu, sigma, skew, shape, logr)
}

c_psstd <- function(q, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_psstd`, q, mu, sigma, skew, shape)
}

c_qsstd <- function(p, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_qsstd`, p, mu, sigma, skew, shape)
}

c_djsu <- function(x, mu, sigma, skew, shape, logr) {
.Call(`_tsdistributions_c_djsu`, x, mu, sigma, skew, shape, logr)
}

c_qjsu <- function(p, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_qjsu`, p, mu, sigma, skew, shape)
}

c_pjsu <- function(q, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_pjsu`, q, mu, sigma, skew, shape)
}

c_rjsu <- function(n, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_rjsu`, n, mu, sigma, skew, shape)
}

c_rsnorm <- function(n, mu, sigma, skew) {
.Call(`_tsdistributions_c_rsnorm`, n, mu, sigma, skew)
}

c_dsnorm <- function(x, mu, sigma, skew, logr) {
.Call(`_tsdistributions_c_dsnorm`, x, mu, sigma, skew, logr)
}

c_psnorm <- function(q, mu, sigma, skew) {
.Call(`_tsdistributions_c_psnorm`, q, mu, sigma, skew)
}

c_qsnorm <- function(p, mu, sigma, skew) {
.Call(`_tsdistributions_c_qsnorm`, p, mu, sigma, skew)
}

c_rged <- function(n, mu, sigma, shape) {
.Call(`_tsdistributions_c_rged`, n, mu, sigma, shape)
}

c_dged <- function(x, mu, sigma, shape, logr) {
.Call(`_tsdistributions_c_dged`, x, mu, sigma, shape, logr)
}

c_pged <- function(q, mu, sigma, shape) {
.Call(`_tsdistributions_c_pged`, q, mu, sigma, shape)
}

c_qged <- function(p, mu, sigma, shape) {
.Call(`_tsdistributions_c_qged`, p, mu, sigma, shape)
}

c_rsged <- function(n, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_rsged`, n, mu, sigma, skew, shape)
}

c_dsged <- function(x, mu, sigma, skew, shape, logr) {
.Call(`_tsdistributions_c_dsged`, x, mu, sigma, skew, shape, logr)
}

c_psged <- function(q, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_psged`, q, mu, sigma, skew, shape)
}

c_qsged <- function(p, mu, sigma, skew, shape) {
.Call(`_tsdistributions_c_qsged`, p, mu, sigma, skew, shape)
}

c_dhyp <- function(x, mu, sigma, skew, shape, logr) {
.Call(`_tsdistributions_c_dhyp`, x, mu, sigma, skew, shape, logr)
}

c_rghyp <- function(n, mu = 0, delta = 1, alpha = 1, beta = 0, lambda = 1) {
.Call(`_tsdistributions_c_rghyp`, n, mu, delta, alpha, beta, lambda)
}

Empty file modified R/distribution.R
100644 → 100755
Empty file.
Empty file modified R/estimation.R
100644 → 100755
Empty file.
Empty file modified R/methods.R
100644 → 100755
Empty file.
Empty file modified R/moments.R
100644 → 100755
Empty file.
Loading

0 comments on commit 327a184

Please sign in to comment.