Learn R Programming

refund (version 0.1-6)

pcre: pffr-constructor for PC-basis functional random effects

Description

Fits functional random effects, by restricting them to the span of the leading eigenfunctions of the functional covariance

Usage

pcre(id, efunctions, evalues, yind)

Arguments

id
grouping variable: a factor.
efunctions
matrix of eigenfunction evaluations on grid points yind (yind> x ).
evalues
eigenvalues associated with efunctions.
yind
vector of grid points on which responses $Y(t)$ are evaluated.

Value

  • a list used internally for constructing an appropriate call to mgcv::gam

Details

pcre fits functional random effects $B_i(t)$ for a grouping variable id, using as a basis the eigenfunctions $\phi_m(t)$ in efunctions with eigenvalues $\lambda_m$ in evalues: $B_i(t) \approx \sum_m^M \phi_m(t)\delta_{im}$ with independent $\delta_{im} \sim N(0, \sigma^2\lambda_m)$, where $\sigma^2$ is estimated and controls the overall contribution of the $B_i(t)$, while the relative importance of the $M$ eigenfunctions is controlled by the supplied eigenvalues evalues. Can be used to model smooth residual functions if id is simply an index of functional observations. This is an experimental feature and not well tested yet, use at your own risk.