# santaR

### Functional splines for Short AsyNchronous Time-series Analysis

Short time evolutions can be analysed by estimating each individual trajectory as a smooth spline through time.

Variables are representative of the underlying process and evolve smoothly through time.
Observations and measurements are noisy realisations of these underlying smooth functions of time.

Once each individual trajectory is estimated, the smooth curves become the new observational unit for further data analysis such as estimation of group curves and identification of time profiles significantly altered between groups.

The present approach is resilient to:

- Low sampling, short time-series
- Individual variability and measurement noise
- Missing observations
- Asynchronous measurements
- Non-linear time response

### 1 - Import Data

Data can be imported using a CSV file containing the raw data or a .RData file with the data and metaData dataframe. Previously fitted data can also be directly loaded for further analysis or plotting.

- CSV

  A CSV file with observations as rows and metadata (time, individual, group(s) of observations) and data (variables to fit) as columns. First row is the column name.

- .RData

  A .RData file containing 2 data.frame inData and inMeta.

- Fitted Data

  A .RData file containing the input data as well as the result of fit as generated by the export function.

### Optional - DF search

The degree of freedom (DF) parameter controls how closely the spline fits the input data (controlling overfitting).
This parameter is dependent on the study design (number of time-points, sampling rate, time-scale of the function of time under study) and therefore only needs to be selected once per dataset.

DF Search helps choose an adequate DF to apply across all variables for a given dataset:

- A PCA extracts the eigen-trajectories across all variables. The DF that will best fit that subset of eigen-trajectories is expected to be satisfactory for all trajectories in the dataset.
- An automatical fit returns the optimal DF based on different goodness of fit metrics.
- The resulting fit of a given DF can be visualised (and compare manual vs automated selection).
- The number of trajectories that must be rejected due to a too low number of observations (depending on the DF selected) can be visualised.

### 2 - Analysis

Once the data imported, each variable can be fitted:

- Each individual trajectory can be fitted
- A group trajectory fitted
- Confidence bands on the group time trajectory can be calculated
- If multiple groups are given, variables significantly altered time profiles between groups can be identified
- Selected variables can be plotted

### 3 - Export

Input data, fitted data, as well as selected variables can be saved.

### Copyright

The present software is licensed under GPLv3.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. http://www.gnu.org/licenses/