PPCKO: Principal Predictive Components for Estimating an Autoregressive Operator
 
Loading...
Searching...
No Matches
traits_ko.hpp File Reference

Contains customized types and enumerator for customized template parameters, exploited in the algorithm. More...

#include <Eigen/Dense>
#include <tuple>
#include <vector>
#include <array>
#include <variant>
#include <type_traits>
#include <cmath>
#include <string>

Go to the source code of this file.

Classes

struct  KO_Traits
 Contains the customized types for fts, covariances, PPCs, etc... More...
 
struct  CV_algo
 Contains PPCKO versions implemented. More...
 

Typedefs

using valid_err_cv_1_t = std::vector<double>
 
using valid_err_cv_2_t = std::vector<std::vector<double>>
 
using valid_err_variant = std::variant<valid_err_cv_1_t,valid_err_cv_2_t>
 
using results_err_t = std::tuple<KO_Traits::StoringVector, double, int, std::vector<double>, std::vector<double>, KO_Traits::StoringMatrix, KO_Traits::StoringMatrix, std::vector<std::array<double,2>>, KO_Traits::StoringArray, valid_err_variant>
 
using results_no_err_t = std::tuple<KO_Traits::StoringVector, double, int, std::vector<double>, std::vector<double>, KO_Traits::StoringMatrix, KO_Traits::StoringMatrix, std::vector<std::array<double,2>>, KO_Traits::StoringArray>
 
template<VALID_ERR_RET valid_err_ret>
using results_t = typename std::conditional<valid_err_ret,results_err_t,results_no_err_t>::type
 

Enumerations

enum  SOLVER { ex_solver = 0 , gep_solver = 1 }
 The available solvers for PPCKO algorithm. More...
 
enum  K_IMP { NO = 0 , YES = 1 }
 If the number of PPCs k is a parameter. More...
 
enum  VALID_ERR_RET { NO_err = 0 , YES_err = 1 }
 If validation error has to be stored and returned. More...
 
enum  CV_STRAT { AUGMENTING_WINDOW = 0 }
 Strategy for training/validation splitting during cv. More...
 
enum  CV_ERR_EVAL { MSE = 0 }
 How to compute validation errors during cv. More...
 

Detailed Description

Contains customized types and enumerator for customized template parameters, exploited in the algorithm.

Author
Andrea Enrico Franzoni

Typedef Documentation

◆ results_err_t

using results_err_t = std::tuple<KO_Traits::StoringVector, double, int, std::vector<double>, std::vector<double>, KO_Traits::StoringMatrix, KO_Traits::StoringMatrix, std::vector<std::array<double,2>>, KO_Traits::StoringArray, valid_err_variant>

Types for the results: tuple is exploited, dimension and types depends on if valdiation errors are returned and which ones eventually

◆ results_t

template<VALID_ERR_RET valid_err_ret>
using results_t = typename std::conditional<valid_err_ret,results_err_t,results_no_err_t>::type

Type for the returning error: depending on

Parameters
valid_err_retenumerator VALID_ERR_RET: if errors have to be returned on not

◆ valid_err_cv_1_t

using valid_err_cv_1_t = std::vector<double>

Types for the errors: variant is used (for cv on both parameter a matrix is returned, a vector otherwise)

Enumeration Type Documentation

◆ CV_ERR_EVAL

How to compute validation errors during cv.

Enumerator
MSE 

Estimate of the L2 norm loss.

◆ CV_STRAT

enum CV_STRAT

Strategy for training/validation splitting during cv.

Enumerator
AUGMENTING_WINDOW 

Fixing an instant: training set are all the instant up to it, validation the next one. At each iteration: the previous validation set is inglobated into the previous training set for the new one. Validation set is shifted by one.

◆ K_IMP

enum K_IMP

If the number of PPCs k is a parameter.

Enumerator
NO 

k is not passed as parameter, has to be found using cumulative explanatory power

YES 

k is already known (it will be fixed if doing cv on it)

◆ SOLVER

enum SOLVER

The available solvers for PPCKO algorithm.

Enumerator
ex_solver 

Inverted square root regularzied covariance and retrieving PPCs from phi.

gep_solver 

Using GEP to avoid to avoid inverted square root.

◆ VALID_ERR_RET

If validation error has to be stored and returned.

Enumerator
NO_err 

Validation errors are not stored and not returned (memory saving)

YES_err 

Validation errors are stored and returned.