BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class DistanceCostFunction( ErrorDistribution )Source

To calculate a distance based cost function

For one observation with n counts it holds

     f( d ) = exp( -SUM( d / s ) )

where d are the distances and s is the scale

The function is mostly used to calculate the likelihood L of traveling-salesman-like problems

Author Do Kester.

DistanceCostFunction( copy=None )

Constructor.

Parameters

  • copy : DistanceCostFunction
         distribution to be copied.

copy( )

Return copy of this.

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

logLikelihood_alt( problem, allpars )
Return the negative sum of the distances.

Parameters

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

logLdata( problem, allpars )
Return the individual distances (multiplied by the weights).

Parameters

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

partialLogL( model, param, fitIndex )
Does not work for this class

Parameters

  • model : Model
         model to calculate mock data
  • param : array_like
         parameters of the model
  • fitIndex : array_like
         indices of the params to be fitted
Methods inherited from ErrorDistribution