LikelihoodFunction.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * @file LikelihoodFunction.h
  3. * @author Erik Rodner
  4. * @date 02/17/2010
  5. */
  6. #ifndef _NICE_OBJREC_LIKELIHOODFUNCTIONINCLUDE
  7. #define _NICE_OBJREC_LIKELIHOODFUNCTIONINCLUDE
  8. namespace OBJREC {
  9. /** @class LikelihoodFunction
  10. * abstract class for squash functions phi(y,f)
  11. * It can be used to define noise models for Gaussian
  12. * process classification
  13. *
  14. * @author Erik Rodner
  15. */
  16. class LikelihoodFunction
  17. {
  18. protected:
  19. public:
  20. LikelihoodFunction();
  21. virtual ~LikelihoodFunction();
  22. /**
  23. * @brief third derivation of the likelihood function
  24. * The third derivation is important for Laplace approximation in
  25. * the GP framework.
  26. *
  27. * @param y label
  28. * @param f latent function value
  29. *
  30. * @return value of the third derivation
  31. */
  32. virtual double thirdgrad ( double y, double f ) const = 0;
  33. /**
  34. * @brief second derivation of the likelihood function
  35. *
  36. * @param y label
  37. * @param f latent function value
  38. *
  39. * @return value of the second derivation
  40. */
  41. virtual double hessian ( double y, double f ) const = 0;
  42. /**
  43. * @brief first derivation of the likelihood function
  44. *
  45. * @param y label
  46. * @param f latent function value
  47. *
  48. * @return value of the first derivation
  49. */
  50. virtual double gradient ( double y, double f ) const = 0;
  51. /**
  52. * @brief logarithm of the likelihood function
  53. *
  54. * @param y label
  55. * @param f latent function value
  56. */
  57. virtual double logLike ( double y, double f ) const = 0;
  58. /**
  59. * @brief calculate the likelihood
  60. *
  61. * @param y label
  62. * @param f latent function value
  63. *
  64. * @return likelihood value
  65. */
  66. virtual double likelihood ( double y, double f ) const = 0;
  67. };
  68. }
  69. #endif