BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class HarmonicDynamicModel( HarmonicModel,Dynamic )Source

Harmonic oscillator Model of adaptable order.

f( x:p ) = ∑j ( pk cos( 2 π j x ) + pk+1 sin( 2 π j x ) )

j = 1, N; k = 0, 2N

The parameters are initialized at 1.0. It is a linear model.

Author Do Kester

Attributes

  • minOrder : int
         minimum degree of polynomial (def=1)
         Can also be read as minComp
  • maxOrder : None or int
         maximum degree of polynomial (def=None)
         Can also be read as maxComp

Attributes from Dynamic

     ncomp (= order), deltaNpar, minComp (= minOrder), maxComp (= maxComp), growPrior

Attributes from HarmonicModel

     order, period

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

Examples

harm = HarmonicDynamicModel( 3 )            # period = 1
print harm.getNumberOfParameters( )         # 6
harm = HarmonicModel( 4, period=2.7 )       # period = 2.7

Category mathematics/Fitting

HarmonicDynamicModel( order, minOrder=1, maxOrder=None, period=1.0, fixed=None, growPrior=None, copy=None, **kwargs )

Harmonic of a adaptable order.

The model starts as a HarmonicModel of order = 1 Growth of the model is governed by a prior.

Parameters

  • order : int
         order to start with. It should be minOrder <= order <= maxOrder
  • minOrder : int
         minimum degree of polynomial (def=1)
  • maxOrder : None or int
         maximum degree of polynomial (def=None)
  • period : float
         period of the oscilation
  • fixed : None
         If fixed is not None an AttributeError is raised
  • growPrior : None or Prior
         governing the birth and death.
         ExponentialPrior (scale=2) if maxOrder is None else UniformPrior
  • copy : HarmonicDynamicModel
         model to copy

Raises

AttributeError when fixed parameters are requested ValueError when order is outside [min..max] range

copy( )

Copy method.

isDynamic( )

changeNComp( dn )

basePrior( k )
Return the prior for parameter k.

Parameters

  • k : int
         the parameter to be selected.

baseName( )

Return a string representation of the model.

Methods inherited from HarmonicModel,
Methods inherited from LinearModel
Methods inherited from Model
Methods inherited from FixedModel
Methods inherited from BaseModel
Methods inherited from Dynamic