Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucio authored and Lucio committed Oct 11, 2024
1 parent e17d511 commit 2fad596
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 30 deletions.
55 changes: 28 additions & 27 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# INAr 0.2.3

* Added the `disc_unif` and `mix_bin_negbin` arrival options into the `genINAR`function.
* Added the `disc_unif`, `mix_bin` and `mix_bin_negbin` arrival options into the `genINAR`function.

* [testing] Playing with some code about parallel computing in the C++ code.


# INAr 0.2.2
Expand All @@ -12,7 +14,7 @@

# INAr 0.2.1

* Added Harris-McCabe test statistic.
* [testing] Added Harris-McCabe test statistic.
* Bootstrap procedures are still on development phase.


Expand All @@ -23,7 +25,7 @@

# INAr 0.1.1

* Preparing the support of the Harris-McCabe test statistics for the upcoming 0.2 update
* [testing] Preparing the support of the Harris-McCabe test statistics for the upcoming 0.2 update


# INAr 0.1.0
Expand Down Expand Up @@ -52,22 +54,22 @@
# INAr 0.0.11

* Added a new test in `test.R` that follow the same concept of the previous one:
* Added the `SMCboot.test` function that computes the semiparametric or parametric bootstrap Sun-McCabe Score test statistics (with Poisson or Negative Binomial arrivals for the moment). The function returns an object of class `htest`.
* In future the the C++ routines that compute the tests will become internal.
* Added the `SMCboot.test` function that computes the semiparametric or parametric bootstrap Sun-McCabe Score test statistics (with Poisson or Negative Binomial arrivals for the moment). The function returns an object of class `htest`.
* In future the the C++ routines that compute the tests will become internal.


# INAr 0.0.10

* Added a new script, namely `test.R`, that will include all the front-end test functions.
* Added the `SMC.test` function that computes the Sun-McCabe Score test statistics (with Poisson or Negative Binomial arrivals for the moment). The function returns an object of class `htest`.
* In future the bootstrapped version of the above tests will be added and the C++ routines that compute the tests will become internal.
* Added the `SMC.test` function that computes the Sun-McCabe Score test statistics (with Poisson or Negative Binomial arrivals for the moment). The function returns an object of class `htest`.
* In future the bootstrapped version of the above tests will be added and the C++ routines that compute the tests will become internal.


# INAr 0.0.9

* Preparing for the first CRAN submission:
* Minor changes and few modifications;
* Script cleaning.
* Minor changes and few modifications;
* Script cleaning.


# INAr 0.0.8
Expand Down Expand Up @@ -96,32 +98,33 @@
# INAr 0.0.5

* Improvement of the `INARfit.R` code to fit INAR(p) models. Now `INARfit()` performs a full Y-W estimation from a Poisson INAR(r) family, following the results of Du and Li. Some additional Rcpp utility functions (script `Xmoments.cpp`) have been added:
* `Xmoments()` [in development], compute the first two moments for the original series and the residual series. As output it returns mean and variance of both the starting and residual series, and the estimated residual series;
* `Xresid()` [in development], generates the series of residual values.
* `Xmoments()` [in development], compute the first two moments for the original series and the residual series. As output it returns mean and variance of both the starting and residual series, and the estimated residual series;
* `Xresid()` [in development], generates the series of residual values.


# INAr 0.0.4

* First `INARfit.R` code to fit INAR(p) models:
* `INARfit()` [in development], fitting an INAR(p) process, by using several procedures. At the momemt is hardcoded and works only for the Poisson case and only YW is provided;
* `est_mom()` [in development], estimation of innovations' parameters. At the momemt is hardcoded and works only for the Poisson case.
* `INARfit()` [in development], fitting an INAR(p) process, by using several procedures. At the momemt is hardcoded and works only for the Poisson case and only YW is provided;
* `est_mom()` [in development], estimation of innovations' parameters. At the momemt is hardcoded and works only for the Poisson case.


# INAr 0.0.3

* Generalization of genINAR function, now it generates INAR(p) models nstead of INAR(1).

* Added stationarity condition check in `genINAR()` function.

* The old `par` input vector contained both the thinning operator (at the first position) and innovations' parameters, now this vector is split is two: `a` and `par`, where:
* `a` contains the p thinning parameters of the INAR(p) to be generated
* `par` contains exclusively the innovations' parmeters
* `a` contains the p thinning parameters of the INAR(p) to be generated
* `par` contains exclusively the innovations' parmeters

* Development of the C++ part to generate INAR(p) processes

* deleted INAR1\_gen.cpp and included the routine `INAR1\_ cpp` in INARp\_gen.cpp
* development of the more general routine `INARp\_ cpp`;
* the line `sim = clone(resid)` was added to avoid the shallow copy effect;
* INARp_gen.cpp contains the routine to generate an INAR(p) process;
* at the moment `INAR1\_ cpp` si obsolete, after some testing it will be deleted.
* deleted INAR1\_gen.cpp and included the routine `INAR1\_ cpp` in INARp\_gen.cpp
* development of the more general routine `INARp\_ cpp`;
* the line `sim = clone(resid)` was added to avoid the shallow copy effect;
* INARp_gen.cpp contains the routine to generate an INAR(p) process;
* at the moment `INAR1\_ cpp` si obsolete, after some testing it will be deleted.


# INAr 0.0.2
Expand All @@ -133,16 +136,14 @@
* Added references.

* `DESCRIPTION` file updated

* additions: `URL`, `Roxygen`, `Depends: R (>= 4.2.1)`, `RdMacros`, `LinkingTo`, `RoxygenNote`;
* modifications: `Depends: R (>= 4.2.1)`, `Imports: Rcpp (>= 1.0.0)`, `RcppArmadillo`, `MASS`, `Rdpack`.
* additions: `URL`, `Roxygen`, `Depends: R (>= 4.2.1)`, `RdMacros`, `LinkingTo`, `RoxygenNote`;
* modifications: `Depends: R (>= 4.2.1)`, `Imports: Rcpp (>= 1.0.0)`, `RcppArmadillo`, `MASS`, `Rdpack`.


# INAr 0.0.1

* Initialization of the package, first settings.

* First working version of the package:

* use of `Rcpp` and `RccpARmadillo` to add C++ code;
* a preliminary version of the function `inarGEN()` is implemented.
* use of `Rcpp` and `RccpARmadillo` to add C++ code;
* a preliminary version of the function `inarGEN()` is implemented.
2 changes: 1 addition & 1 deletion R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ HMC_BOOT_Cpp <- function(x, B) {
.Call('_INAr_HMC_BOOT_Cpp', PACKAGE = 'INAr', x, B)
}

#' Wrapper function for compution the Harris-McCabe bootstrap score test.
#' Wrapper function for computation the Harris-McCabe bootstrap score test.
#' !!!WARNING!!! Still under development, do not use! It will be replaced by INARtest() in future versions.
#' @param X NumericVector
#' @param B int
Expand Down
11 changes: 9 additions & 2 deletions src/INARboot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ NumericVector HMC_Cpp(NumericVector x){
// std::cout << eval << std::endl;
DataFrame TAB = ecdfcpp(eval, x);
NumericVector values = TAB["value"];
NumericVector relfreq = TAB["fallback"]; // improved estimatof probs. (check!)
NumericVector relfreq = TAB["fallback"]; // improved estimator probs. (check!)

NumericVector pi_hat(n-1);
NumericVector pi_hat_L1(n-1);
Expand Down Expand Up @@ -798,7 +798,7 @@ NumericVector HMC_BOOT_Cpp(NumericVector x, int B){
return s_temp;
}

//' Wrapper function for compution the Harris-McCabe bootstrap score test.
//' Wrapper function for computation the Harris-McCabe bootstrap score test.
//' !!!WARNING!!! Still under development, do not use! It will be replaced by INARtest() in future versions.
//' @param X NumericVector
//' @param B int
Expand Down Expand Up @@ -840,11 +840,18 @@ List HMCtest_boot(NumericVector X, int B){


/*** R
# SMC
set.seed(1913)
x <- rpois(500,40)
# x <- c(1, 2, 12, 0, 2, 3, 2, 3, 4, 0, 1, 1, 2, 2, 4)
# HMC_Cpp(seq(0,20,by=2))
HMC_Cpp(genINAR(100, a = 0.5, par = 2, arrival = "poisson")$X)
# HMC
set.seed(1913)
x <- rpois(500,40)
HMC_Cpp(x)
# B <- 21
# # test 1:
# S <- HMC_Cpp(x)
Expand Down

0 comments on commit 2fad596

Please sign in to comment.