Skip to content

Latest commit

 

History

History
108 lines (83 loc) · 5.66 KB

File metadata and controls

108 lines (83 loc) · 5.66 KB




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 ) [source]

Constructor.

Parameters

  • copy : DistanceCostFunction
         distribution to be copied.

copy( ) [source]

Return copy of this.

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

logLikelihood_alt( problem, allpars ) [source]
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 ) [source]
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 ) [source]
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