Skip to content

Commit

Permalink
Fixed CRAN dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
feng-li committed Apr 7, 2024
1 parent 12d04bd commit 9ac23cb
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 55 deletions.
90 changes: 49 additions & 41 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
Package: gratis
Type: Package
Title: Generating Time Series with Diverse and Controllable Characteristics
Package: gratis
Title: Generating Time Series with Diverse and Controllable
Characteristics
Version: 1.0.5
Authors@R: c(
person("Yanfei", "Kang", role = c("aut"), email = "[email protected]", comment = c(ORCID = "0000-0001-8769-6650")),
person("Feng", "Li", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-4248-9778")),
person("Rob", "Hyndman", role = c("aut"), email = "[email protected]", comment = c(ORCID = "0000-0002-2140-5352")),
person("Mitchell", "O'Hara-Wild", role = "ctb", email = "[email protected]", comment = c(ORCID = "0000-0001-6729-7695")),
person("Bocong", "Zhao", role = "ctb", email = "[email protected]", comment = c(ORCID = "0000-0001-8434-9047"))
)
Description:
Generates synthetic time series based on various univariate time series models
including MAR and ARIMA processes. Kang, Y., Hyndman, R.J., Li, F.(2020) <doi:10.1002/sam.11461>.
LazyLoad: yes
Repository: CRAN
person("Yanfei", "Kang", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-8769-6650")),
person("Feng", "Li", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4248-9778")),
person("Rob", "Hyndman", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0002-2140-5352")),
person("Mitchell", "O'Hara-Wild", , "[email protected]", role = "ctb",
comment = c(ORCID = "0000-0001-6729-7695")),
person("Bocong", "Zhao", , "[email protected]", role = "ctb",
comment = c(ORCID = "0000-0001-8434-9047"))
)
Description: Generates synthetic time series based on various univariate
time series models including MAR and ARIMA processes. Kang, Y.,
Hyndman, R.J., Li, F.(2020) <doi:10.1002/sam.11461>.
License: GPL-3
URL: https://github.com/ykang/gratis
BugReports: https://github.com/ykang/gratis/issues/
Depends: R (>= 3.5.0)
Depends:
R (>= 3.5.0)
Imports:
doRNG,
dplyr,
foreach,
forecast (>= 8.16),
GA,
generics,
magrittr,
methods,
mvtnorm,
polynom,
purrr,
stats,
tibble,
tsfeatures,
tsibble,
utils,
shiny
doRNG,
dplyr,
feasts,
fGarch,
foreach,
forecast (>= 8.16),
GA,
generics,
magrittr,
methods,
mvtnorm,
polynom,
purrr,
shiny,
stats,
tibble,
tsfeatures,
tsibble,
utils
Suggests:
feasts,
fGarch,
knitr,
rmarkdown,
rlang,
shinydashboard
NeedsCompilation: no
License: GPL-3
knitr,
rlang,
rmarkdown,
shinydashboard
VignetteBuilder:
knitr
Encoding: UTF-8
RoxygenNote: 7.2.3
VignetteBuilder: knitr
LazyLoad: yes
NeedsCompilation: no
Repository: CRAN
RoxygenNote: 7.3.1
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export(pi_coefficients)
export(rmixnorm)
export(rmixnorm_ts)
export(simulate_target)
import(fGarch)
import(feasts)
import(shiny)
importFrom(GA,ga)
importFrom(GA,gaControl)
Expand Down
4 changes: 2 additions & 2 deletions R/arima_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ pi_coefficients <- function(ar = 0, d = 0L, ma = 0, sar = 0, D = 0L, sma = 0, m
}

n <- 500L
theta <- -c(coef(ma * sma))[-1]
theta <- -c(stats::coef(ma * sma))[-1]
if (length(theta) == 0L) {
theta <- 0
}
phi <- -c(coef(ar * sar)[-1], numeric(n))
phi <- -c(stats::coef(ar * sar)[-1], numeric(n))
q <- length(theta)
pie <- c(numeric(q), 1, numeric(n))
for (j in seq(n)) {
Expand Down
5 changes: 2 additions & 3 deletions R/gratis-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
#' @importFrom GA startParallel garun
#' @importFrom tsfeatures tsfeatures
#' @importFrom doRNG "%dorng%"
#' @import fGarch
#' @import shiny
#' @import feasts
#' @keywords internal

"_PACKAGE"

NULL

# utils::globalVariables(c(".", "x", "Season2"))
# magrittr::`%>%`
2 changes: 1 addition & 1 deletion R/mar_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' \code{phi}, \code{Phi}, \code{sigmas} and \code{weights}.
#' @author Rob J Hyndman
#' @seealso \code{\link{simulate.mar}}
#' @examples
#' @examplesIf require("fGarch", quietly=TRUE)
#' n <- 100
#' # Quarterly MAR model with randomly selected parameters
#' model1 <- mar_model(seasonal_periods = 4)
Expand Down
6 changes: 3 additions & 3 deletions R/rmixmorm.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ rmixnorm <- function(n, means, sigmas, weights) {
for (i in seq(k)) {
if (nsamp[i] > 0) {
data[idx == i, ] <- mvtnorm::rmvnorm(
n = nsamp[i], mean = means[, i],
sigma = as.matrix(sigmas[, , i]),
n = nsamp[i], mean = means[, i],
sigma = as.matrix(sigmas[, , i]),
checkSymmetry = FALSE
)
}
Expand Down Expand Up @@ -113,7 +113,7 @@ dmixnorm <- function(x, means, sigmas, weights, log = FALSE) {
#' Conditional Distributions using Smooth Mixtures of Asymmetric Student T Densities,
#' Journal of Statistical Planning and Inference, 140(12), pp. 3638-3654.
#' @author Feng Li, Central University of Finance and Economics.
#' @examples
#' @examplesIf require("fGarch", quietly=TRUE)
#' n <- 1000
#' means.ar.par.list <- list(c(0, 0.8), c(0, 0.6, 0.3))
#' require("fGarch")
Expand Down
2 changes: 1 addition & 1 deletion inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ vers <- paste("R package version", vers)

citHeader("To cite the gratis package in publications, please use:")
bibentry(bibtype = "Manual",
title = "{gratis}: {GeneRAting TIme Series} with diverse and controllable characteristics",
title = "{gratis}: An R package for {GeneRAting TIme Series} with diverse and controllable characteristics",
author = c(as.person("Yanfei Kang"),
as.person("Feng Li"),
as.person("Rob J Hyndman"),
Expand Down
2 changes: 1 addition & 1 deletion man/gratis-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/mar_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/rmixnorm_ts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions vignettes/QuickStart.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Introduction to gratis}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteDepends{feasts}
%\VignetteEncoding{UTF-8}
---

Expand Down Expand Up @@ -62,11 +63,11 @@ qmar %>%
autoplot(value)
```

Each of these series comes from the same MAR model, but with different stochastic inputs. Although the two ARIMA models are seasonal, the seasonality is too weak to been in the plots.
Each of these series comes from the same MAR model but with different stochastic inputs. Although the two ARIMA models are seasonal, the seasonality is too weak to been in the plots.

# Generate mutiple seasonal time series
# Generate multiple seasonal time series

Time series can exhibit multiple seasonal pattern of different length, especially when series observed at a high frequency such as daily or hourly data. Here is an example in which we generate 1 hourly time series of length 2 weeks.
Time series can exhibit multiple seasonal patterns of different lengths, especially when series are observed at a high frequency such as daily or hourly data. Here is an example in which we generate 1 hourly time series of length 2 weeks.

```{r hmarmodel}
hmar <- mar_model(seasonal_periods = c(24, 7*24))
Expand Down

0 comments on commit 9ac23cb

Please sign in to comment.