source: trunk/yat/regression/Poisson.h @ 3614

Last change on this file since 3614 was 3614, checked in by Peter, 6 years ago

refs #867 and #882. Interface for Negative Binomiual and Poisson regression

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1#ifndef theplu_yat_regression_poisson
2#define theplu_yat_regression_poisson
3
4// $Id: Poisson.h 3614 2017-02-06 01:37:33Z peter $
5
6/*
7  Copyright (C) 2017 Peter Johansson
8
9  This file is part of the yat library, http://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 <http://www.gnu.org/licenses/>.
23*/
24
25#include "Multivariate.h"
26
27namespace theplu {
28namespace yat {
29namespace regression {
30
31  /**
32     Poisson regression models count data from a poisson distribution
33     \f$ y \in Po(m(x)) \f$ in which the the expectation value, \f$ m
34     \f$ is modeled as \f$ log(m) = \Beta_0 + \Beta_1 x_1 + ... +
35     \Beta_p x_p \f$, or for a given model, \f$ \Beta \f$, and input
36     vector \f$ x \f$, the expectation value \f$ E(Y | x, \Beta) =
37     \exp(\Beta'x) \f$
38
39     \since new in yat 0.15
40   */
41  class Poisson : public Multivariate
42  {
43  public:
44    /**
45       \brief fit model
46     */
47    void fit(const utility::Matrix& x, const utility::VectorBase& y);
48
49    /**
50       \return parameters \f$ \Beta \f$
51     */
52    const utility::Vector& fit_parameters(void) const;
53
54    /**
55       Predicted value given \a x. The prediction is calculated as
56       \f$ \exp{\beta_0 + \beta_1 x_1 +...+\beta_p x_p} \f$
57     */
58    double predict(const utility::VectorBase& x) const;
59  private:
60  };
61
62}}}
63
64#endif
Note: See TracBrowser for help on using the repository browser.