---
title: "FSSA"
author: "Mehdi Maadooliat"
date: "May 26, 2019"
output: html_document
runtime: shiny
---

# Side Bar Panel
Contains the inputs that will be used in different `sub-panels`. The following inputs will be used in sub-panels **Basis Functions** (to generate the basis functions), **Data Description** (for Smoothing, FPCA, SSA and FSSA):

* [Degree](https://en.wikipedia.org/wiki/Degree_of_a_polynomial) of B-spline Basis  
* [Deg. of freedom](https://en.wikipedia.org/wiki/Degrees_of_freedom) of B-spline or Fourier Basis  
* [Groups](https://en.wikipedia.org/w/index.php?title=Singular_spectrum_analysis#Main_algorithm_of_SSA): 3rd step of the SSA(FSSA) algorithm:
    + Each group is specified via a vector (e.g. 'c(1,2,4)' or '1:3') and seperated from other groups via comma (',')
* **d** is the dimensions used in FPCA, SSA and FSSA (Scree, W.Correlation, Paired, Singular Vectors & Functions, and Periodogram Plots)
* **Functions**
    + Demean: Subtract the *mean* to obtain mean-zero functions
    + Dbl Range: extending the y-axis to cover all potential mirrord functions (e.g. sometime FPCs may get multiply by a '-' sign)
* [Win.L.](https://en.wikipedia.org/w/index.php?title=Singular_spectrum_analysis#Basic_SSA): Window length parameter used in *SSA* and *FSSA*
* **run (F)SSA** button is used to run SSA and FSSA using the specified parameters for the given dataset.
The top inputs (above red line) are mostly to describe the *basis functions*. The bottom inputs (below red line) are used to specify *SSA* and *FSSA* parameters.

# Main Panel
## Data
One can either use the files posted in Server

* *Callcenter*: used in the *FSSA paper (package)*
* *NDVI* and *EVI*: Jambi Sattelite data used in the *FSSA paper (package)*

or simulate FTS (see *FSSA* paper for more details),

or upload any FTS to be analyzed.

## Basis Functions
* Using a visualization technique, we illustrate the B-spline (or Fourier) basis that is used in the algorithm.

## Data Description (SSA Summary)
**Summary** of the data:

* Functional Time Series: Provide a lot of visualizations to describe the data.
  + _Plot Choices_:
    + _All_: Cobmines all _FTS_
    + _Multiple_: Combine _FTS_ at different _Period(frequency)_ together and the combined _clusters_ can be tracked by the end user
    + _Single_: Track _FTS_ individually
  + _Plots_:
    + _Time Series_: provides the observed _FTS_
    + _True Functions_: provides the TRUE _FTS_ (in the case of simulation)
    + _Basis Functions_: embeddes th basis functions on top of _FTS_
    + _Smoothing_: provides the results of smoothing via basis functions
    + _Functional PCA_: provides _FPCA_ resuls from the _fda_ package
    + _Multivariate SSA_: provides _MSSA_ resuls from the _Rssa_ package
    + _Functional SSA_: provides _FSSA_ resuls from the _Rfssa_ package
* How many basis? (GCV): provides the optimal number of basis based on _GCV_ criteria.

In this panel we can also select outputs under **SSA** and **FSSA**:

* _Scree_ plot: based on the _trajectory_ matrix
* _W.Correlation_ plot: w-correlation plot
* _Paired_ plots
* _Singular Vectors_ plots
* _Periodogram_ plots
* _Singular Functions_ (Heat or Regular plots)
* _Reconstruction_ of FTS using different _Type_ of plots (Heat, Regular, 3D(line) and 3D(surface))

## Manual
The sub-panel that contains this _instruction manual_.
