HarmonicDynamicModel = class HarmonicDynamicModel(HarmonicModel, Dynamic) |
|
HarmonicDynamicModel(order, minOrder=1, maxOrder=None, period=1.0, fixed=None,
growPrior=None, copy=None, **kwargs)
Harmonic oscillator Model of adaptable order.
f( x:p ) = ∑_j ( p_k cos( 2 π j x ) + p_k+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 |
|
- Method resolution order:
- HarmonicDynamicModel
- HarmonicModel
- LinearModel
- Model
- FixedModel
- BaseModel
- Dynamic
- builtins.object
Constructor:
- 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
Methods defined here:
- baseName()
- Return a string representation of the model.
- basePrior( k )
- Return the prior for parameter k.
Parameters
----------
k : int
the parameter to be selected.
- changeNComp( dn )
- copy()
- Copy method.
- isDynamic()
- Return whether the model can change the number of parameters dynamically.
Methods inherited from HarmonicModel:
Methods inherited from LinearModel:
Methods inherited from Model:
Overloaded operators and aliases
Other methods
- addModel( model )
- appendModel( model, operation )
- assignDF1( partial, i, dpi )
- assignDF2( partial, i, dpi )
- chainLength()
- checkLimits( param, parlist )
- correctParameters( params )
- derivative( xdata, param, useNum=False )
- divideModel( model )
- domain2Unit( dvalue, kpar=None )
- getIntegralUnit()
- getLimits()
- getLinearIndex()
- getNumberOfParameters()
- getParameterName( k )
- getParameterUnit( k )
- getPrior( k )
- hasLimits( fitindex=None )
- hasPriors( isBound=True )
- isMixed()
- isNullModel()
- isolateModel( k )
- multiplyModel( model )
- nextPrior()
- numDerivative( xdata, param )
- numPartial( xdata, param )
- operate( res, pars, next )
- partial( xdata, param, useNum=False )
- partialDomain2Unit( dvalue )
- pipeModel( model )
- result( xdata, param=None )
- setLimits( lowLimits=None, highLimits=None )
- setPrior( k, prior=None, **kwargs )
- shortName()
- stayInLimits( oldpar, trypar, parlist )
- strictNumericDerivative( xdata, param )
- strictNumericPartial( xdata, params, parlist=None )
- subtractModel( model )
- testPartial( xdata, params )
- unit2Domain( uvalue, kpar=None )
Methods inherited from FixedModel:
Methods inherited from BaseModel:
Methods inherited from Dynamic:
- alterFitindex( findex, location, dnp, offset )
- alterParameterNames( dnp )
- alterParameterSize( dnp, offset, location=None, value=0)
- alterParameters( param, location, dnp, offset, value=None )
- grow( offset=0, rng=None, **kwargs )
- setDynamicAttribute( name, value )
- setGrowPrior( growPrior=None, min=1, max=None, name='Comp')
- shrink( offset=0, rng=None, **kwargs )
- shuffle( param, offset, np, rng )
|
|