serf.design: Helper function for Serfling models

Description Usage Arguments Value

Description

Given a time series and a specified number of harmonic and polynomial terms, this function builds the dataframe needed for the call to lm(). See serf.fit function for example on how to fit model.

Usage

1
2
serf.design(ts = g.ts, t1 = 1, t2 = length(ts), period = 52.2,
  trend.poly = 1, harmonic = c(1, 2), covar = NULL)

Arguments

ts

response vector of numeric values representing the time series to be modeled. By default this is set to 'g.ts' the global time series which MUST be specified by the user before calling this function

t1

is the integer index of the parameter 'ts' where model fitting begins; defaults to 1

t2

is the integer index of the parameter 'ts' where model fitting ends; defaults to length(ts)

period

numeric value; defaults to 52.2

trend.poly

is specified as an integer vector representing the degrees of the polynomial terms to be included; defaults to 1 i.e. single linear trend term

harmonic

is also specified as an integer vector representing fractional multiples of the period e.g. 'harmonic=c(1,2)' specifies two harmonic pairs (two sine terms and two cosine terms) of one period and one half-period respectively

covar

adds additional covariance factors but this feature not currently implemented; defaults to NULL

Value

Data frame containing predictors for model fitting and forecasting


ensoesie/epidemics documentation built on May 28, 2019, 8:37 p.m.