Learn R Programming

FluxPoint (version 0.1.2)

plot_FluxPoint: Plot multivariate time series with detected change points and estimated means

Description

Visualizes multivariate time series data together with the estimated fluctuating mean sequence and detected change points obtained from the proposed change point detection (CPD) algorithm. Each variable is plotted in a separate panel (facet), with vertical dashed lines marking detected change points and solid curves showing the estimated means when provided.

Usage

plot_FluxPoint(data, muhats, cps, titlename = "", xaxis = "")

Value

A ggplot2 object displaying the time series, estimated means (if provided), and detected change points.

Arguments

data

Numeric matrix of dimension \(n \times p\), representing the observed multivariate time series \(\{\mathbf{y}_t\}_{t=1}^n\).

muhats

Optional numeric matrix of the same dimension as `data`, giving the estimated fluctuating mean sequence \(\{\hat{\boldsymbol{\mu}}_t\}_{t=1}^n\). If NULL, only raw data and detected change points are shown.

cps

Numeric vector of detected change point locations.

titlename

Character string for the plot title.

xaxis

Character string for the x-axis label (e.g., "Time").

Details

When \(p = 1\), the function produces a single plot displaying the observed time series, the estimated mean curve, and vertical dashed lines indicating the detected change points. When \(p > 1\), each variable is shown in a separate facet with independently scaled y-axes for improved readability. If muhats is provided, the estimated mean is overlaid using geom_line(); otherwise, only the observed data and detected change points are displayed.