Designs For Time Series Regression
tsDesign.Rd
Create designs for time series regression (linear regression or quantile regression) for meteorological time series.
Usage
tsDesign(
dt,
type = c("polynom", "trigo", "sinwave"),
df = 3,
period = "year",
phi = NULL,
keepTrig = FALSE,
origin = NULL
)
Arguments
- dt
A
POSIXct
orDate
object.- type
Type of design.
- df
Number of basis functions, or "degree of freedom".
- period
Not used. Can only be one year and is used only in the trigonometric case.
- phi
Numeric vector of phases used only when
type
is"sinwave"
.- keepTrig
Logical. Used only when
type
is"sinwave"
. IfTRUE
the base trigonometric functionssinj1
,sinj2
, ...,cosj1
,cosj2
, ... are kept in the result, along with the functionssinjPhi1
,sinjPhi2
, ...- origin
An origin for the time. Used only in the polynomial case. The same value must be used in fits and predictions.
Details
The choice is for now between polynomial functions that can be used to describe a trend) and trigonometric functions with period one year (365.25 days) that can be used for the seasonality.
"polynom" Can be used to describe a polynomial with degree
<= df - 1
. Thedf
basis functions are named"Cst"
, then:"t1"
,"t2"
, ..."trigo" The basis contains
df = 2 * K + 1
trigonometric functions given in the order of increasing harmonics. These are: the constant function"Cst"
and then theK
couples of one cosine function and one sine function, with names"cosj1"
,"sinj1"
,"cosj2"
,"sinj2"
, ..."sinwave" With
K = df %/% 2
, theK + 1
basis functions are the constant"Cst"
, thenK
sine wave functions in the order of increasing harmonics with names"sinjPhi1"
,"sinjPhi2"
, ...