Skip to content

Latest commit

 

History

History
148 lines (114 loc) · 7.55 KB

File metadata and controls

148 lines (114 loc) · 7.55 KB




class PoissonErrorDistribution( ErrorDistribution )[source]

To calculate a Poisson likelihood.

For one observation with n counts it holds

  f( n,x ) = xn / ( ex * n! )

where x is the expected counts

The function is mostly used to calculate the likelihood L, or easier to use log likelihood, logL.

     logL = ∑( n * log( x ) - x - log( n! ) )

Weights are not accepted in this ErrorDistribution; they are silently ignored.

Author Do Kester.

PoissonErrorDistribution( copy=None ) [source]

Constructor.

Parameters

  • copy : PoissonErrorDistribution
         distribution to be copied.

copy( ) [source]

Return copy of this.

acceptWeight( ) [source]
True if the distribution accepts weights. Always false for this distribution.

getScale( problem, allpars=None ) [source]
Return the noise scale.

*** Gaussian approximation ***

Parameters

  • problem : Problem
         to be solved
  • allpars : array_like
         None take parameters from problem.model
         list of all parameters in the problem

logLikelihood_alt( problem, allpars ) [source]
Return the log( likelihood ) for a Poisson distribution.

Parameters

  • problem : Problem
         to be solved
  • allpars : array_like
         list of all parameters in the problem

logLdata( problem, allpars, mockdata=None ) [source]
Return the log( likelihood ) for each residual

logL = sum( logLdata )

Parameters

  • problem : Problem
         to be solved
  • allpars : array_like
         list of all parameters in the problem
  • mockdata : array_like
         as calculated by the model

partialLogL_alt( problem, allpars, fitIndex ) [source]
Return the partial derivative of log( likelihood ) to the parameters.

Parameters

  • problem : Problem
         to be solved
  • allpars : array_like
         list of all parameters in the problem
  • fitIndex : array_like
         indices of parameters to be fitted

nextPartialData( problem, allpars, fitIndex, mockdata=None ) [source]
Return the partial derivative of log( likelihood ) to the parameters.

Parameters

  • problem : Problem
         to be solved
  • allpars : array_like
         list of all parameters in the problem
  • fitIndex : array_like
         indices of parameters to be fitted
  • mockdata : array_like
         as calculated by the model
Methods inherited from ErrorDistribution