R Under development (unstable) (2023-11-25 r85635 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(HyperbolicDist) > if (FALSE){ + fileList <- list.files("../R/") + fileList <- fileList[-grep(".+~",fileList)] + fileNames <- paste("../R/", fileList, sep = "") + lapply(fileNames,source) + } > > Theta <- c(2,2,1,2,1) > mu <- Theta[5] > ### Test ghypMom: mu moments > (m1 <- ghypMean(Theta)) [1] 3.125532 > m1 - mu [1] 2.125532 > ghypMom(1, Theta, momType = "mu") [1] 2.125532 > momIntegrated("ghyp", order = 1, param = Theta, about = mu) [1] 2.125532 > ghypMom(2, Theta, momType = "mu") [1] 7.709928 > momIntegrated("ghyp", order = 2, param = Theta, about = mu) [1] 7.709928 > ghypMom(10, Theta, momType = "mu") [1] 82423263 > momIntegrated("ghyp", order = 10, param = Theta, about = mu) [1] 82423263 > > ### Test ghypMom: raw moments > ghypMean(Theta) [1] 3.125532 > ghypMom(1, Theta, momType = "raw") [1] 3.125532 > momIntegrated("ghyp", order = 1, param = Theta, about = 0) [1] 3.125532 > ghypMom(2, Theta, momType = "raw") [1] 12.96099 > momIntegrated("ghyp", order = 2, param = Theta, about = 0) [1] 12.96099 > ghypMom(10, Theta, momType = "raw") [1] 198600687 > momIntegrated("ghyp", order = 10, param = Theta, about = 0) [1] 198600687 > > ### Test ghypMom: central moments > ghypMom(1, Theta, momType = "central") [1] 0 > momIntegrated("ghyp", order = 1, param = Theta, about = m1) [1] -2.814589e-16 > ghypVar(Theta) [1] 3.192044 > ghypMom(2, Theta, momType = "central") [1] 3.192044 > momIntegrated("ghyp", order = 2, param = Theta, about = m1) [1] 3.192044 > ghypMom(10, Theta, momType = "central") [1] 12276439 > momIntegrated("ghyp", order = 10, param = Theta, about = m1) [1] 12276439 > > > > proc.time() user system elapsed 0.12 0.03 0.15