Skip to content

Commit

Permalink
minor script cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucio authored and Lucio committed Oct 9, 2024
1 parent a7598eb commit e17d511
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 24 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added R/.DS_Store
Binary file not shown.
17 changes: 4 additions & 13 deletions R/INAR1_different_innovations.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,12 @@ genINAR <- function(n, a, par, arrival="poisson", burnout=500, ...){

resid_ <- rgeom(s,pi_)
}
else if(arrival=="discunif"){
stopifnot(length(par)==2)
else if(arrival=="disc_unif"){
stopifnot(length(par)==1)

minu_ <- unname(par[1])
maxu_ <- unname(par[2])
stopifnot(minu_ < maxu_)
max_ <- unname(par[1])

resid_ <- round(runif(s,minu_,maxu_),0)
resid_ <- sample(0:max_,s,replace = TRUE)
}
else if(arrival=="binomial"){
stopifnot(length(par)==2)
Expand Down Expand Up @@ -269,13 +267,6 @@ genINAR <- function(n, a, par, arrival="poisson", burnout=500, ...){
resid_[selettore] <- rbinom(sum(selettore),enne_,pb_)
resid_[!selettore] <- rnbinom(sum(!selettore),g_,p.compl_)
}
else if(arrival=="disc_unif"){
stopifnot(length(par)==1)

max_ <- unname(par[1])

resid_ <- round(runif(s,0,max_),0)
}
else{
stop("please specify one of the available distributions", call. = FALSE)
}
Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ Generation, estimation and testing of INteger Autoregressive models
The INAr Project aims to provide a set of tools for the study of time series having a discrete support by using the integer-valued autoregressive models, namely INAR(p), considered the counterpart to the conventional autoregressive models AR(p).
INAR(p) models are proved to useful for the study of realizations of random variables arising from counting, with range contained in the discrete set of non-negative integers.


## Installation

``` r
# Install from CRAN
# !!!---not available at the moment---!!!
# install.packages("INAr")

# Or the development version from GitHub
# install.packages("devtools")
devtools::install_github("blog-neas/INAr")
```


## Roadmap

#### Main Steps
Expand Down Expand Up @@ -69,17 +83,6 @@ The project considers to distribute a set of packages for the study of INAR(p) p
- [ ] References
- [ ] Further steps and developments

## Installation

``` r
# Install from CRAN
# !!!---not available at the moment---!!!
# install.packages("INAr")

# Or the development version from GitHub
# install.packages("devtools")
devtools::install_github("blog-neas/INAr")
```

# Contributing to INAr development

Expand Down
Binary file added data/.DS_Store
Binary file not shown.
Binary file added inst/.DS_Store
Binary file not shown.
Binary file added man/.DS_Store
Binary file not shown.
Binary file added src/.DS_Store
Binary file not shown.

0 comments on commit e17d511

Please sign in to comment.