Learn R Programming

ctmva (version 1.6.0)

ccor: Curve correlation

Description

Inputs raw data representing two curves, applies penalized B-spline smoothing to the two curves, and computes the curve correlation between them via a call to cor.ct.

Usage

ccor(y, time, curve = NULL, k = 15, min.overlap = 0, min.n = 8)

Value

A list with components

y,time

the supplied y and time

mod1,mod2

models for the two curves, outputted by gam

fd1,fd2

functional data objects (see fd) for the two curves

estcor

estimated curve correlation

Arguments

y

either a vector or a two-column matrix, without missing values; see Details

time

a vector of time points

curve

curve indicator; see Details

k

number of B-spline basis functions

min.overlap

minimum overlap of the two curves' time ranges

min.n

minimum number of observations per curve

Author

Philip Tzvi Reiss <reiss@stat.haifa.ac.il>, Noemi Foa, Dror Arbiv and Biplab Paul <paul.biplab497@gmail.com>

Details

If y is a two-column matrix, the two curves are observed at the time points given by time; in this case length(time) must equal nrow(y), and curve is ignored. If y is a vector, it must have the same length as both time and curve. In this case y contains the observations on both curves, while elements of time and curve identify the observation time and the curve being observed, respectively.

See Also

cor.ct, b.spline

Examples

Run this code

# see example for ccor_posim

Run the code above in your browser using DataLab