Build a design matrix for polynomial regression.
polynomX(date, degree = 2, origin = NULL)
A vector with class "Date"
or that can be
coerced to this class.
The maximal degree \(d\). The basis contains \(d + 1\) functions \(t^0\), \(t^1\), ..., \(t^d\).
Optional vector of length 1 with class "Date"
or character that can be coerced to this class. Gives the origin
for the transformation of dates into numeric values. The default
value is 1970-01-01
, see Date
.
An object with class "bts"
inheriting from
"matrix"
. This is essentially a numeric matrix having the
value of the basis functions as its columns. Each row corresponds
to an element of the given date
vector. By convention, the
columns are named Cst
then t1
, t2
, ....
The provided date is converted into a numeric variable \(t\)
corresponding to the number of years from the origin. The basis
functions are functions of this variable \(t\). A year is
defined as 365.25
days, so \(t\) can not take only
integer values.
This function is intended to provide regressors for Time
Varying GEV models corresponding to TVGEV
objects. Since
the response then usually corresponds to block maxima, the date
variable gives either the begining or the end of each block.
As a general rule, it is a good practice to
choose origin
close to the centre of the time period. This
is especially important when a polynomial of degree \(>= 2\) is
used since problems of convergence are likely to occur otherwise.
breaksX
for a basis of Truncated Power functions.
and TVGEV
to for Time Varying GEV models.