cumres.hpp
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "utils.hpp"
13 
14 namespace target {
15 
21  class cumres {
22  public:
23  unsigned n;
24  arma::vec r;
25  arma::umat ord;
26  arma::mat dr;
27  arma::mat ic;
28  arma::mat inp;
29  arma::vec b;
30  arma::mat qt;
31  arma::mat eta;
32 
33  cumres(const arma::vec &r,
34  const arma::mat &dr,
35  const arma::mat &ic);
36  void order(const arma::mat &inp, arma::vec b = arma::vec());
37  arma::vec rnorm();
38  arma::mat obs();
39  arma::mat sample(const arma::umat &idx = arma::umat());
40  arma::mat sample(unsigned R,
41  const arma::umat &idx = arma::umat(),
42  bool quantiles = true);
43  };
44 
45 
46 } // namespace target
arma::mat qt
Stores data for calculations of quantiles.
Definition: cumres.hpp:30
arma::mat obs()
Calculate observed cumulative residual process.
Definition: cumres.cpp:89
Various utility functions and constants.
arma::mat ic
Influence curve.
Definition: cumres.hpp:27
arma::mat sample(const arma::umat &idx=arma::umat())
Simulate one process under the null hypothesis of a correctly specified model.
Definition: cumres.cpp:117
arma::vec rnorm()
Draw n samples from standard normal distribution.
Definition: cumres.cpp:64
arma::mat eta
Cumulative derivative of residuals.
Definition: cumres.hpp:31
arma::umat ord
Stores order of observations to cumulate after.
Definition: cumres.hpp:25
arma::mat dr
Derivative of residuals wrt model parameters.
Definition: cumres.hpp:26
arma::mat inp
Variable to order residuals after.
Definition: cumres.hpp:28
arma::vec r
Residuals.
Definition: cumres.hpp:24
arma::vec b
Bandwidth of moving average.
Definition: cumres.hpp:29
cumres(const arma::vec &r, const arma::mat &dr, const arma::mat &ic)
Constructor.
Definition: cumres.cpp:22
unsigned n
Sample size.
Definition: cumres.hpp:23
void order(const arma::mat &inp, arma::vec b=arma::vec())
Set variables to order after and bandwidth.
Definition: cumres.cpp:38