cumres.hpp
Go to the documentation of this file.
1 
10 #pragma once
11 #include "utils.hpp"
12 
13 namespace target {
14 
20  class cumres {
21  public:
22  unsigned n;
23  arma::vec r;
24  arma::umat ord;
25  arma::mat dr;
26  arma::mat ic;
27  arma::mat inp;
28  arma::vec b;
29  arma::mat qt;
30  arma::mat eta;
31 
32  cumres(const arma::vec &r,
33  const arma::mat &dr,
34  const arma::mat &ic);
35  void order(const arma::mat &inp, arma::vec b=arma::vec());
36  arma::vec rnorm();
37  arma::mat obs();
38  arma::mat sample(const arma::umat &idx = arma::umat());
39  arma::mat sample(unsigned R,
40  const arma::umat &idx = arma::umat(),
41  bool quantiles = true);
42  };
43 
44 
45 } // namespace target
arma::mat qt
Stores data for calculations of quantiles.
Definition: cumres.hpp:29
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:26
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:30
arma::umat ord
Stores order of observations to cumulate after.
Definition: cumres.hpp:24
arma::mat dr
Derivative of residuals wrt model parameters.
Definition: cumres.hpp:25
arma::mat inp
Variable to order residuals after.
Definition: cumres.hpp:27
arma::vec r
Residuals.
Definition: cumres.hpp:23
arma::vec b
Bandwidth of moving average.
Definition: cumres.hpp:28
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:22
void order(const arma::mat &inp, arma::vec b=arma::vec())
Set variables to order after and bandwidth.
Definition: cumres.cpp:38