ccor: Curve correlation

View source: R/ccor.R

ccorR Documentation

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)

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

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.

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

Author(s)

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

See Also

cor.ct, b.spline

Examples


# see example for ccor_posim


ctmva documentation built on Nov. 20, 2025, 5:06 p.m.

Related to ccor in ctmva...