From 16d79e8fe3e75eab5af19fdd18093fcc85d1dd9c Mon Sep 17 00:00:00 2001 From: Mitchell Date: Mon, 3 Feb 2020 22:22:08 -0800 Subject: [PATCH] Have fourier() use consistent arguments as fable --- DESCRIPTION | 2 +- R/model.R | 8 ++++---- man/fasster-model.Rd | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 69e0c4c..5eb920e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -39,7 +39,7 @@ License: GPL-3 Encoding: UTF-8 LazyData: true ByteCompile: true -RoxygenNote: 6.1.1 +RoxygenNote: 7.0.2.9000 Roxygen: list(markdown = TRUE, roclets=c('rd', 'collate', 'namespace')) Language: en-GB VignetteBuilder: knitr diff --git a/R/model.R b/R/model.R index 94d520a..bcd2e5c 100644 --- a/R/model.R +++ b/R/model.R @@ -126,10 +126,10 @@ train_fasster <- function(.data, formula, specials, include = NULL){ colnames(out$FF) <- rep(deparse(cl), NCOL(out$FF)) out }, - fourier = function(period, ...){ + fourier = function(period, K, ...){ period <- get_frequencies(period, self$data, .auto = "smallest") cl <- sys.call() - out <- dlmModTrig(period, ...) + out <- dlmModTrig(period, q = K, ...) colnames(out$FF) <- rep(deparse(cl), NCOL(out$FF)) out }, @@ -176,8 +176,8 @@ train_fasster <- function(.data, formula, specials, include = NULL){ #' #' Special DLM components can be specified using special functions defined below: #' \itemize{ -#' \item seas(s): Creates seasonal factors with seasonality s -#' \item trig(s): Creates seasonal fourier terms with seasonality s +#' \item seas(s): Creates seasonal factors with seasonal period s +#' \item fourier(s, K): Creates seasonal fourier terms with seasonal period s and K harmonics #' \item poly(n): Creates a polynomial of order n (poly(1) creates a level, poly(2) creates a trend) #' \item ARMA(ar, ma): Creates ARMA terms with coefficient vectors ar and ma #' \item custom(dlm): Creates a custom dlm structure, using \code{\link[dlm]{dlm}} diff --git a/man/fasster-model.Rd b/man/fasster-model.Rd index 4e92a5e..d590b3e 100644 --- a/man/fasster-model.Rd +++ b/man/fasster-model.Rd @@ -30,8 +30,8 @@ This is implemented using a time-varying DLM with the switching behaviour encode Special DLM components can be specified using special functions defined below: \itemize{ -\item seas(s): Creates seasonal factors with seasonality s -\item trig(s): Creates seasonal fourier terms with seasonality s +\item seas(s): Creates seasonal factors with seasonal period s +\item fourier(s, K): Creates seasonal fourier terms with seasonal period s and K harmonics \item poly(n): Creates a polynomial of order n (poly(1) creates a level, poly(2) creates a trend) \item ARMA(ar, ma): Creates ARMA terms with coefficient vectors ar and ma \item custom(dlm): Creates a custom dlm structure, using \code{\link[dlm]{dlm}}