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

SparsePlot

Sparse plot


Description

Create sparse plot to see the sparsity of the data.

Usage

SparsePlot(Lt, interval, ...)

Arguments

Lt

A list of n vectors, where n is the sample size. Each entry contains the observation time in ascending order for each subject.

interval

A vector of length two denoting the supporting interval.

...

Other arguments passed into plot.

Details

For the sparse plot, x-axis is the observation time while y-axis represents various subjects.

Value

Create the corresponding sparse plot.

Examples

# Generate data
n <- 100
interval <- c(0, 10)
lambda_1 <- 9 #the first eigenvalue
lambda_2 <- 1.5 #the second eigenvalue
eigfun <- list()
eigfun[[1]] <- function(x){cos(pi * x/10)/sqrt(5)}
eigfun[[2]] <- function(x){sin(pi * x/10)/sqrt(5)}
score <- cbind(rnorm(n, 0, sqrt(lambda_1)), rnorm(n, 0, sqrt(lambda_2)))
# DataNew1 and DataNew2 have different sparsity
DataNew1 <- GenDataKL(n, interval = interval, sparse = 6:8,
                      meanfun = function(x){0}, score = score,
                      eigfun = eigfun, sd = sqrt(0.1))
DataNew2 <- GenDataKL(n, interval = interval, sparse = 2:4,
                      meanfun = function(x){0}, score = score,
                      eigfun = eigfun, sd = sqrt(0.1))
# Create sparse plots
par(mfrow = c(1, 2))
SparsePlot(DataNew1$Lt, interval = interval)
SparsePlot(DataNew2$Lt, interval = interval)
par(mfrow = c(1, 1))

KFPCA

Kendall Functional Principal Component Analysis

v1.0
GPL (>= 3)
Authors
Rou Zhong [aut, cre]
Initial release

We don't support your browser anymore

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