Skip to content

Commit

Permalink
version 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
config-i1 authored and cran-robot committed Mar 25, 2022
1 parent 190b485 commit bcf184b
Show file tree
Hide file tree
Showing 29 changed files with 689 additions and 329 deletions.
12 changes: 6 additions & 6 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: greybox
Type: Package
Title: Toolbox for Model Building and Forecasting
Version: 1.0.4
Date: 2022-02-05
Version: 1.0.5
Date: 2022-03-24
Authors@R: c(person("Ivan", "Svetunkov", email = "ivan@svetunkov.ru", role = c("aut", "cre"),
comment="Lecturer at Centre for Marketing Analytics and Forecasting, Lancaster University, UK"),
person("Yves R.", "Sagaert", role = c("ctb"),
Expand All @@ -20,8 +20,8 @@ Description: Implements functions and instruments for regression model building
that allow producing forecasts from these models and visualising them.
License: GPL (>= 2)
Depends: R (>= 3.5.0)
Imports: stats, generics (>= 0.1.2), graphics, utils, lamW, pracma,
nloptr, statmod, zoo, texreg, methods
Imports: stats, generics (>= 0.1.2), graphics, utils, pracma, nloptr,
statmod, zoo, texreg, methods
LinkingTo: Rcpp
Suggests: smooth (>= 3.1.0), doMC, doParallel, foreach, testthat,
rmarkdown, knitr
Expand All @@ -30,11 +30,11 @@ RoxygenNote: 7.1.2
VignetteBuilder: knitr
Encoding: UTF-8
NeedsCompilation: yes
Packaged: 2022-02-05 19:18:14 UTC; config
Packaged: 2022-03-24 16:46:43 UTC; config
Author: Ivan Svetunkov [aut, cre] (Lecturer at Centre for Marketing Analytics
and Forecasting, Lancaster University, UK),
Yves R. Sagaert [ctb] (Visiting Research at Centre for Marketing
Analytics and Forecasting, Lancaster University, UK)
Maintainer: Ivan Svetunkov <ivan@svetunkov.ru>
Repository: CRAN
Date/Publication: 2022-02-07 03:20:08 UTC
Date/Publication: 2022-03-25 07:50:09 UTC
54 changes: 28 additions & 26 deletions MD5
@@ -1,9 +1,9 @@
285e785c4a295715c25fc4d277395acc *DESCRIPTION
c66d427083e5798047fe1910e57e9184 *NAMESPACE
819ddb78ed98a67ad584698d50f934cf *NEWS
b04f00196442fad912053f13321c737f *R/RcppExports.R
978b06a34310ff8cea3a257392acde1b *DESCRIPTION
6ca80239cfc5773062bc751557591591 *NAMESPACE
2204c0d1f6f75bc44fcdc3d022d3916c *NEWS
5fd089adc4f2a4d99984ee2800bf7c3f *R/RcppExports.R
84102924dc2ea9f9e6a6617a36c72b17 *R/alaplace.R
1768d2e3a5384ab6cfb5ae607232367b *R/alm.R
17952334f5c1cfee0a5dcf9ac38c28aa *R/alm.R
7f57915462e0aded02869de96d8eb3f9 *R/association.R
80bfe3c5a617af67cc15f5624113138a *R/bcnorm.R
d056586e3cae9050471ff0c4a480c3f3 *R/coefbootstrap.R
Expand All @@ -17,42 +17,42 @@ d3bef00d6410f3cc9c1d8acd7f3965e4 *R/gnorm.R
f0ec88cdb14ba6777ae25a54c49c0050 *R/greybox-package.R
cad33cb70b10fff7ba3d4540f75f8f11 *R/intermittentDemandIdentificator.R
886e34a5b537253c143196aef3456a8c *R/isFunctions.R
c3f66f453aac76ab1434b1157a947a53 *R/laplace.R
1b951110181d7fed7a3ecdd9fb004940 *R/laplace.R
0c5a992841ee1ff2b1d73bf53a69d91f *R/lmCombine.R
73344e04ceb45694b28350248b8c9dc9 *R/lmDynamic.R
98fc47becaf618778f1687cd243e2341 *R/logitnorm.R
2979ba491960d4f5d69f95ff266c8220 *R/mcor.R
18eb6eefad68b34ac2bc0d00b83ac45d *R/methods.R
95530f4ba4a27f1bfe5b45db74700396 *R/methods.R
79bf50ada96e276176b7e559fdf70f4b *R/nemenyi.R
873bc5653f241231d5a40dc16ff5c2c0 *R/pcor.R
08e116585c9cd7d3cc474d095dcff303 *R/rmcb.R
1388d5674a0ec484be12d4be702cb7bd *R/ro.R
3ace4c78eb16888397c193c991ab4bb3 *R/scaler.R
f0f8df3711f25e5668816a1a49f6cb68 *R/scaler.R
e6f69d02e1342a127c5084efd49c802d *R/spread.R
7cafa6e9aea7f3db1a301b0874020236 *R/stepwise.R
c0dcee3748719186f72a9d1db2850232 *R/svet.R
dd5249700fe80009f7954f8c9bf2d1f8 *R/tableplot.R
e22bb09839259410dae906188be0aeaa *R/temporaldummy.R
579dc4e71ea737d0c150178738327479 *R/svet.R
650ac6464899743fd1b481bb0363c8f5 *R/tableplot.R
81d551ea07c3aaad8796444ff2cf612c *R/temporaldummy.R
ecd3e77665fe428e2035ea8c5726cc85 *R/tplnorm.R
d451829c2588249bc04277d06fe50436 *R/xregExpander.R
bdb7ecee051a442d310f4e83e6e9865d *R/xregMultiplier.R
964ae5b1c6a404c9bcfdb87d7512f2c3 *R/xregTransformer.R
7da19ac80ec12e8a120b8a74b5a0c853 *R/zzz.R
4d455c144e16325d724e5b057bb3432c *README.md
0db3c3ed454f4da2a045682dd3b9b559 *build/partial.rdb
a588e57e375fd59a2995a7a1444ba2d7 *build/vignette.rds
05c50027330773b2a13afc2af333a854 *inst/doc/alm.R
4c421b6a0e9448edc7e09817c468115c *inst/doc/alm.Rmd
50900f4779f17694e3371c319083c518 *inst/doc/alm.html
aecc6a88bd09d596f78b8cca861b967e *build/partial.rdb
4b3689d0bcbedeb40ffe80f7b9b6d457 *build/vignette.rds
494d17e9642b38d6e9e7ccc0145ccf40 *inst/doc/alm.R
9806719b02b8a8b24b1669a59a880014 *inst/doc/alm.Rmd
e9a7a6328fe84d8fc02fc0f00156831d *inst/doc/alm.html
75d5150f03862add1eaf3c26ef9b289a *inst/doc/greybox.R
928d78f6bdd54bfc5adc543975288559 *inst/doc/greybox.Rmd
ad8506ab446ce1c51ba54f41b1e3e49a *inst/doc/greybox.html
1f8852805f8f5f5c9ee1a7fa14a2581a *inst/doc/greybox.html
35f3b10303d1942a7d0726228f9fe5d4 *inst/doc/maUsingGreybox.R
6b5fcb2644ce454ac2bf05431c2e36ef *inst/doc/maUsingGreybox.Rmd
f822d0c52a38dc104f121d879f15b899 *inst/doc/maUsingGreybox.html
92aa81735a831064a38ec0b64ad22a7d *inst/doc/maUsingGreybox.html
10b8eca7f21953371ad6814000a88e7d *inst/doc/ro.R
19ceb5991b7e482e47e8bc8f75ff5b5c *inst/doc/ro.Rmd
50c0695d9c361ae2b8e6d5da58d6e611 *inst/doc/ro.html
7cf11ebc69233918fe113ae6913e6910 *inst/doc/ro.html
084cfd9d04d61751b81f50f6017fa29d *man/ALaplace.Rd
86b0ff67fc5f746252e691cb2ec7e913 *man/BCNormal.Rd
06dfe4ddda355a61e1414d16b970e76d *man/FNormal.Rd
Expand All @@ -71,38 +71,40 @@ dd4df3dd66d4a3aafc593b5b2f3ad79b *man/cramer.Rd
c6b538d5f9bff5449a7fe8047bfe596c *man/determination.Rd
1dc52c899063e6e770578cf9b32ea6b4 *man/error-measures.Rd
7107d89e7d1666697d37f3ffe06b2ff9 *man/errorType.Rd
443f8b65d684f958f66ba26aa9681185 *man/extractScale.Rd
fdd84a8a2b3aed980ea0120175ed902f *man/gnorm.Rd
9e3022339f0b58bf292a3592cfc9729f *man/graphmaker.Rd
43ab18b05f78cdae33e312de5b728cfc *man/greybox.Rd
e2bcd1ed25f4b52bfb430344f99672c5 *man/hm.Rd
1e34c2b9512e79ff04ad5ed818181e1c *man/implant.Rd
aeb5813ae9c2eaabdd1e7b0f7fbed847 *man/isFunctions.Rd
8b179bfa67d7006891db3660b81178bb *man/lmCombine.Rd
1e743a95eabf6e5cd98b129b8a9f9f38 *man/lmDynamic.Rd
16e3869291055e5491fb01326954dfb4 *man/mcor.Rd
e0faa74d73cc4b3540db4a69b883a89a *man/measures.Rd
d1f75183b5576474662d2d16a1a0bd87 *man/nparam.Rd
666b2eeabede0897473f491b757e4aa3 *man/outlierdummy.Rd
594f4058815735be23c75f159600477d *man/outlierdummy.Rd
c6af6523858c09344ecb0327c8b3214f *man/pcor.Rd
54923540c4963b9aa06729808d624afb *man/pinball.Rd
66e6d68240055b35af3002465cc68ef2 *man/plot.greybox.Rd
adcbb10444b1715904a8270a96fba5f3 *man/pointIC.Rd
2329b1a5db9e98f6328ee8a888a6c7c1 *man/pointLik.Rd
c6ebc1c587ffc34c6161c9a0051dbaeb *man/polyprod.Rd
353dc1efe79d793c64ea39de0eadb2cb *man/polyprod.Rd
a5bac11b99312ae39d103f7216f0d08d *man/predict.greybox.Rd
41bad208697a2f2004d9a8936e1bee91 *man/reexports.Rd
74cb54e813f3dc98c52031569e8462f3 *man/rmcb.Rd
7b30511abf634c913d57716ffcc849ea *man/ro.Rd
5156b0fde44ab85cee63b83b5a30906a *man/sm.Rd
b29e4641355205aeb56948067a6cb6b3 *man/sm.Rd
2d9d93bc160afd1199636e8a9752dc39 *man/spread.Rd
2417c3f5e5ed49fbe864447c2aae7c94 *man/stepwise.Rd
6e75842d13a488a1f839ac7a63c658e5 *man/tableplot.Rd
476faba464ba4c5985117c87b01a4516 *man/temporaldummy.Rd
dcbae2a3fc5cf00019d2bded452fd5a9 *man/tableplot.Rd
b787708f34a3713ef586812cd319bbf6 *man/temporaldummy.Rd
a7b1a34273b8b9e98c7c547f40e42822 *man/xregExpander.Rd
ecaff1d893d0e2226b358df3b6e18cd8 *man/xregMultiplier.Rd
d384247a8281dc3ce210c2825d232aca *man/xregTransformer.Rd
bdcaf6740a71dab28cd4493c61807438 *src/RcppExports.cpp
b0129f5614ed7877c7af10bd9dce93b0 *src/polyMult.cpp
4c421b6a0e9448edc7e09817c468115c *vignettes/alm.Rmd
1a13600ccb159c3e3e5352bd1892bf4b *src/polyMult.cpp
9806719b02b8a8b24b1669a59a880014 *vignettes/alm.Rmd
928d78f6bdd54bfc5adc543975288559 *vignettes/greybox.Rmd
8401400e9158cfc020fa9477e42d1fd6 *vignettes/img/ROProcessCO.gif
da71fe35eb5beb45dc2cc8ef16da371a *vignettes/img/ROProcessCOCI.gif
Expand Down
9 changes: 8 additions & 1 deletion NAMESPACE
Expand Up @@ -32,10 +32,15 @@ S3method(determ,lm)
S3method(errorType,default)
S3method(errorType,ets)
S3method(extractAIC,alm)
S3method(extractScale,default)
S3method(extractScale,greybox)
S3method(extractSigma,default)
S3method(extractSigma,greybox)
S3method(forecast,alm)
S3method(forecast,greybox)
S3method(formula,alm)
S3method(hatvalues,greybox)
S3method(implant,alm)
S3method(logLik,alm)
S3method(nobs,alm)
S3method(nobs,greybox)
Expand Down Expand Up @@ -137,11 +142,14 @@ export(dlogitnorm)
export(ds)
export(dtplnorm)
export(errorType)
export(extractScale)
export(extractSigma)
export(extremity)
export(forecast)
export(graphmaker)
export(ham)
export(hm)
export(implant)
export(is.alm)
export(is.greybox)
export(is.greyboxC)
Expand Down Expand Up @@ -228,7 +236,6 @@ importFrom(graphics,polygon)
importFrom(graphics,rect)
importFrom(graphics,text)
importFrom(graphics,title)
importFrom(lamW,lambertWm1)
importFrom(methods,setMethod)
importFrom(nloptr,nloptr)
importFrom(pracma,hessian)
Expand Down
13 changes: 13 additions & 0 deletions NEWS
@@ -1,3 +1,16 @@
greybox v1.0.5 (Release data: 2022-03-24)
==============

Changes:
* Simplified the generics outlierdummy(), temporaldummy() and sm().
* qs() and qlaplace() now use qgnorm() function. We no longer need to rely on lamW package in R.
* New method, implant() for implanting scale model into location one.
* Use analytic vcov in case of loss="MSE".
* New parameter, points, in tableplot. It specifies, whether to produce points in the categories. Helps in reading the plots.
* Order in which in plot.greybox() now matters.
* Some plots in plot.greybox() will now produce plots for the scale model if it is estimated (which=c(2:6,8,9,13:14)).


greybox v1.0.4 (Release data: 2022-02-05)
==============

Expand Down
2 changes: 1 addition & 1 deletion R/RcppExports.R
Expand Up @@ -19,7 +19,7 @@
#'
#' @examples
#'
#' polyprod(c(1,-2,-1),c(1,0.5,0.3))
#' \dontrun{polyprod(c(1,-2,-1),c(1,0.5,0.3))}
#'
#' @useDynLib greybox
#' @export
Expand Down
1 change: 1 addition & 0 deletions R/alm.R
Expand Up @@ -2010,6 +2010,7 @@ alm <- function(formula, data, subset, na.action,
distribution, mu, y, errors,
NULL, occurrence, ellipsis));
scale$call$data <- dataSubstitute;
# Update the formula, which is needed for the proper plots and outputs
scale$formula <- update.formula(scaleFormula,paste0(responseName,"~."));
}
nParam <- nParam + nparam(scale);
Expand Down
45 changes: 23 additions & 22 deletions R/laplace.R
Expand Up @@ -80,31 +80,32 @@ plaplace <- function(q, mu=0, scale=1){
#' @export qlaplace
#' @aliases qlaplace
qlaplace <- function(p, mu=0, scale=1){
return(qgnorm(p, mu=mu, scale=scale, shape=1))
# p <- unique(p);
# mu <- unique(mu);
# scale <- unique(scale);
lengthMax <- max(length(p),length(mu),length(scale));
# If length of p, mu and scale differs, then go difficult. Otherwise do simple stuff
if(any(!c(length(p),length(mu),length(scale)) %in% c(lengthMax, 1))){
laplaceReturn <- array(0,c(length(p),length(mu),length(scale)),
dimnames=list(paste0("p=",p),paste0("mu=",mu),paste0("scale=",scale)));
laplaceReturn[p==0.5,,] <- 1;
laplaceReturn[p==0,,] <- -Inf;
laplaceReturn[p==1,,] <- Inf;
probsToEstimate <- which(laplaceReturn[,1,1]==0);
laplaceReturn[laplaceReturn==1] <- 0;
for(k in 1:length(scale)){
laplaceReturn[probsToEstimate,,k] <- (-scale[k] * sign(p[probsToEstimate]-0.5) *
log(1-2*abs(p[probsToEstimate]-0.5)));
}
laplaceReturn <- laplaceReturn + rep(mu,each=length(p));
# Drop the redundant dimensions
laplaceReturn <- laplaceReturn[,,];
}
else{
laplaceReturn <- mu - scale * sign(p-0.5) * log(1-2*abs(p-0.5));
}
return(laplaceReturn);
# lengthMax <- max(length(p),length(mu),length(scale));
# # If length of p, mu and scale differs, then go difficult. Otherwise do simple stuff
# if(any(!c(length(p),length(mu),length(scale)) %in% c(lengthMax, 1))){
# laplaceReturn <- array(0,c(length(p),length(mu),length(scale)),
# dimnames=list(paste0("p=",p),paste0("mu=",mu),paste0("scale=",scale)));
# laplaceReturn[p==0.5,,] <- 1;
# laplaceReturn[p==0,,] <- -Inf;
# laplaceReturn[p==1,,] <- Inf;
# probsToEstimate <- which(laplaceReturn[,1,1]==0);
# laplaceReturn[laplaceReturn==1] <- 0;
# for(k in 1:length(scale)){
# laplaceReturn[probsToEstimate,,k] <- (-scale[k] * sign(p[probsToEstimate]-0.5) *
# log(1-2*abs(p[probsToEstimate]-0.5)));
# }
# laplaceReturn <- laplaceReturn + rep(mu,each=length(p));
# # Drop the redundant dimensions
# laplaceReturn <- laplaceReturn[,,];
# }
# else{
# laplaceReturn <- mu - scale * sign(p-0.5) * log(1-2*abs(p-0.5));
# }
# return(laplaceReturn);
}

#' @rdname Laplace
Expand Down

0 comments on commit bcf184b

Please sign in to comment.