The columns of a model matrix M
is projected on the
orthogonal complement to the matrix (1,t)
,
resp. (1,t,t^2)
.
Orthogonality is defined w.r.t. an inner product defined by the
matrix diag(weight)
.
detrend( M, t, weight = rep(1, nrow(M)) )
decurve( M, t, weight = rep(1, nrow(M)) )
A model matrix.
The trend defining a subspace. A numerical vector of length
nrow(M)
Weights defining the inner product of vectors x
and y
as sum(x*w*y)
.
A numerical vector of length nrow(M)
, defaults to a vector of
1
s. Must be all non-negative.
A full-rank matrix with columns orthogonal to (1,t)
, for
decurv
, (1,t,t^2)
.
The functions are intended to be used in parametrization of age-period-cohort models.