Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

GetMeanCI

Bootstrap pointwise confidence intervals for the mean function for densely observed data.


Description

Note that bootstrap pointwise confidence intervals do not work for sparsely observed data.

Usage

GetMeanCI(Ly, Lt, level = 0.95, R = 999, optns = list())

Arguments

Ly

A list of n vectors containing the observed values for each individual. Missing values specified by NAs are supported for dense case (dataType='dense').

Lt

A list of n vectors containing the observation time points for each individual corresponding to each element in Ly. Each vector should be sorted in ascending order.

level

A number taking values in [0,1] determing the confidence level. Default: 0.95.

R

An integer holding the number of bootstrap replicates. Default: 999.

optns

A list of options; see FPCA for details.

Value

A list of two elements:

CI

A data frame holding three variables: CIgrid — the time grid where the CIs are evaluated; lower and upper — the lower and upper bounds of the CIs on CIgrid.

level

The confidence level of the CIs

.

Examples

n <- 30
tgrid <- seq(0,1,length.out=21)
phi1 <- function(t) sqrt(2)*sin(2*pi*t)
phi2 <- function(t) sqrt(2)*sin(4*pi*t)
Lt <- rep(list(tgrid), n)
Ly <- lapply(1:n, function(i){
 tgrid + rnorm(1,0,2) * phi1(tgrid) + rnorm(1,0,0.5) * phi2(tgrid) + rnorm(1,0,0.01)
 })
res <- GetMeanCI(Lt = Lt, Ly = Ly, level = 0.9)

fdapace

Functional Data Analysis and Empirical Dynamics

v0.5.6
BSD_3_clause + file LICENSE
Authors
Cody Carroll [aut, cre] (<https://orcid.org/0000-0003-3525-8653>), Alvaro Gajardo [aut], Yaqing Chen [aut], Xiongtao Dai [aut], Jianing Fan [aut], Pantelis Z. Hadjipantelis [aut], Kyunghee Han [aut], Hao Ji [aut], Shu-Chin Lin [ctb], Paromita Dubey [ctb], Hans-Georg Mueller [cph, ths, aut], Jane-Ling Wang [cph, ths, aut]
Initial release
2021-01-10,

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.