BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class KernelModel( NonLinearModel )Source

Kernel Model, a Model build around an Kernel.

The KernelModel is defined as

     f( x:p ) = p0 * K( ( x - p1 ) / p2 )

where K( u ) is a selectable kernel function on the rescaled input u
     u = ( x - p1 ) / p2.

     p0 is the amplitude
     p1 is the center
     p2 is the range.

The parameters are initialized at amp,0,1. the amplitude is such that the function integrates to 1.0. They are listed in the table.

Several kernel functions predefined.

Beware: The "bound" models are unaware of anything outside their range.

Author: Do Kester

Examples

model = KernelModel( )
model.kernel = Triweight()

Attributes

  • kernel : Kernel
         the kernel of this model

Attributes from Model

     npchain, parameters, stdevs, xUnit, yUnit

Attributes from FixedModel

     npmax, fixed, parlist, mlist

Attributes from BaseModel

     npbase, ndim, priors, posIndex, nonZero, tiny, deltaP, parNames

KernelModel( copy=None, kernel=Biweight(), **kwargs )

Kernel Model.

Parameters

  • copy : KernelModel
         model to be copied
  • kernel : Kernel
         kernel class (default = Biweight)
  • fixed : None or dictionary of {int:float|Model}
         int index of parameter to fix permanently.
         float|Model values for the fixed parameters.
         Attribute fixed can only be set in the constructor.
         See: FixedModel

copy( )
Copy method.

baseResult( xdata, params )
Returns the result of the model function.

Parameters

  • xdata : array_like
         values at which to calculate the result
  • params : array_like
         values for the parameters.

basePartial( xdata, params, parlist=None )
Returns the partials at the xdata value.

Parameters

  • xdata : array_like
         values at which to calculate the result
  • params : array_like
         values for the parameters.
  • parlist : array_like
         list of indices active parameters (or None for all)

baseDerivative( xdata, params )
Returns the derivative at the xdata value.

Parameters

  • xdata : array_like
         values at which to calculate the result
  • params : array_like
         values for the parameters.

baseName( )

Returns a string representation of the model.

isBound( )
Return true when the kernel is bound. All non-zero values are between -1 and +1

baseParameterUnit( k )
Return the name of a parameter. Parameters
  • k : int
         the kth parameter.
Methods inherited from NonLinearModel
Methods inherited from Model
Methods inherited from FixedModel
Methods inherited from BaseModel