Learn R Programming

musclesyneRgies (version 1.3.1)

CoA: Centre of activity

Description

Centre of activity

Usage

CoA(x, tol_rel = 1e-06)

Value

The centre of activity of the time series, calculated with circular statistics: a numeric scalar in (0, n] giving the centre of activity on the 1..n axis.

Arguments

x

A numeric time series of length n (samples represent bin centres at 1..n).

tol_rel

Relative tolerance (0–1). If the mean resultant length is less than this value, the CoA is considered undefined and NA is returned. Default is 1e-6.

References

Martino, G. et al. Locomotor patterns in cerebellar ataxia. J. Neurophysiol. 112, 2810–2821 (2014).

Examples

Run this code
# Number of users connected to the Internet through a server every minute
ts <- datasets::WWWusage[1:80]

# Calculate CoA
ts_CoA <- CoA(ts)

# Plot
plot(ts, ty = "l", xlab = "Time", ylab = "Number of users")
graphics::abline(v = ts_CoA, lwd = 2, lty = 2)

Run the code above in your browser using DataLab