yat  0.21pre
MultiCox.h
1 #ifndef theplu_yat_regression_multi_cox
2 #define theplu_yat_regression_multi_cox
3 
4 // $Id: MultiCox.h 4198 2022-08-19 06:26:14Z peter $
5 
6 /*
7  Copyright (C) 2022 Peter Johansson
8 
9  This file is part of the yat library, https://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <https://www.gnu.org/licenses/>.
23 */
24 
25 #include <memory>
26 #include <vector>
27 
28 namespace theplu {
29 namespace yat {
30 namespace utility {
31  class VectorBase;
32  class MatrixBase;
33 }
34 
35 namespace regression {
36 
46  class MultiCox
47  {
48  public:
52  MultiCox(void);
53 
59  MultiCox(const MultiCox& other);
60 
64  MultiCox(MultiCox&& other);
65 
69  ~MultiCox(void);
70 
74  MultiCox& operator=(const MultiCox& other);
75 
79  MultiCox& operator=(MultiCox&& other);
80 
89  void add(const utility::VectorBase& x, double time, bool event);
90 
98  void add(const utility::MatrixBase& x,
99  const utility::VectorBase& time,
100  const std::vector<char>& event);
101 
105  void clear(void);
106 
110  void train(void);
111 
115  double b(size_t i) const;
116 
120  double z(size_t i) const;
121 
126  double p(size_t i) const;
127 
131  double hazard_ratio(size_t i) const;
132 
136  double hazard_ratio_lower_CI(size_t, double alpha=0.95) const;
137 
141  double hazard_ratio_upper_CI(size_t, double alpha=0.95) const;
142 
147  const utility::MatrixBase& covariance(void) const;
148  private:
149  class Impl;
150  std::unique_ptr<Impl> pimpl_;
151  };
152 
153 }}}
154 
155 #endif
MultiCox & operator=(const MultiCox &other)
Definition: MatrixBase.h:54
double hazard_ratio(size_t i) const
The Department of Theoretical Physics namespace as we define it.
MultiCox(void)
Default Constructor.
const utility::MatrixBase & covariance(void) const
Definition: MultiCox.h:46
This is the yat interface to GSL vector.
Definition: VectorBase.h:55
double hazard_ratio_lower_CI(size_t, double alpha=0.95) const
void add(const utility::VectorBase &x, double time, bool event)
add a sample
double z(size_t i) const
double p(size_t i) const
two-sided p-value for the null-hypothesis that is zero.
double b(size_t i) const
double hazard_ratio_upper_CI(size_t, double alpha=0.95) const

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14