SplinesDynamicModel = class SplinesDynamicModel(Modifiable, Dynamic, BasicSplinesModel) |
|
SplinesDynamicModel(modifiable=True, dynamic=True, growPrior=None, minKnots=2, maxKnots=None,
minDistance=0.01, copy=None, **kwargs)
BasicSplinesModel that is modifiable (knot locations) and dynamic (in number
of knots)
Examples
--------
>>> knots = numpy.arange( 17, dtype=float ) * 10 # make equidistant knots from 0 to 160
>>> csm = SplinesModel( knots=knots, order=2 )
>>> print csm.getNumberOfParameters( )
18
# or alternatively:
>>> csm = SplinesModel( nrknots=17, order=2, min=0, max=160 ) # automatic layout of knots
>>> print csm.getNumberOfParameters( )
18
# or alternatively:
>>> npt = 161 # to include both 0 and 160.
>>> x = numpy.arange( npt, dtype=float ) # x-values
>>> csm = SplinesModel( nrknots=17, order=2, xrange=x ) # automatic layout of knots
>>> print csm.getNumberOfParameters( )
18
Attributes
----------
minKnots : int
minimum number of knots
maxDegree : int or None
maximum number of knots
Attributes from Modifiable
--------------------------
modifiable
Attributes from Dynamic
-----------------------
dynamic, ncomp (=degree+1), deltaNpar, minComp (=minDegree+1), maxComp (=maxDegree+1), growPrior
Attributes from SplinesModel
----------------------------
knots, order
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
Limitations
-----------
Dont construct the knots so closely spaced, that there are no datapoints in between. |
|
- Method resolution order:
- SplinesDynamicModel
- Modifiable
- Dynamic
- BasicSplinesModel
- SplinesModel
- LinearModel
- Model
- FixedModel
- BaseModel
- builtins.object
Constructor:
- SplinesDynamicModel( modifiable=True, dynamic=True, growPrior=None, minKnots=2, maxKnots=None,
minDistance=0.01, copy=None, **kwargs)
- Splines on a given set of knots and a given order.
The number of parameters is ( length( knots ) + order - 1 )
Parameters
----------
modifiable : bool
if True allow changement of the knot locations
dynamic : bool
if True allow growth and shrinkage of number of knots
minKnots : int
minimum number of knots (def=2)
maxKnots : None or int
maximum number of Knots
minDistance : float
minimum distance between knots, provided as fraction of average knot distance.
default is ( 0.01 * ( knots[-1] - knots[0] ) / nrknots )
growPrior : None or Prior
governing the birth and death.
ExponentialPrior (scale=2) if maxDegree is None else UniformPrior
copy : PolynomialDynamicModel
model to copy
Parameters for SplinesModel
---------------------------
knots, order, nrknots, min, max, xrange
Raises
------
ValueError if not minKnots <= nrknots <= maxKnots
Methods defined here:
- baseName()
- Returns a string representation of the model.
- changeNComp( dn )
- copy()
- Return a copy.
- grow( offset=0, rng=None, force=False, **kwargs )
- Increase the degree by one upto maxComp ( if present ).
Parameters
----------
offset : int
index where the params of the Dynamic model start
rng : random number generator (obligatory)
to generate a new parameter.
force : bool
dont check maxKnots
Return
------
bool : succes
- shrink( offset=0, rng=None, **kwargs )
- Decrease the degree by one downto minComp ( default 1 ).
Parameters
----------
offset : int
index where the params of the Dynamic model start
rng : random number generator
to generate a new parameter (obligatory)
Return
------
bool : succes
- vary( rng=None, location=None )
- Vary the structure of a Modifiable Model
Default implementation: does nothing.
Parameters
----------
location : int
index of the item to be modified; otherwise random
rng : RNG
random number generator
kwargs : keyword arguments
for specific implementations
- varyAlt( offset=0, rng=None, **kwargs )
- Vary the structure of a Modifiable Model
Parameters
----------
offset : int
index where the params of the Modifiable model start
rng : RNG
random number generator
kwargs : keyword arguments
for specific implementations
Methods inherited from Modifiable:
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 )
- isDynamic()
- setDynamicAttribute( name, value )
- setGrowPrior( growPrior=None, min=1, max=None, name='Comp')
- shuffle( param, offset, np, rng )
Methods inherited from BasicSplinesModel:
Methods inherited from Model:
Overloaded operators and aliases
Other methods
- addModel( model )
- appendModel( model, operation )
- assignDF1( partial, i, dpi )
- assignDF2( partial, i, dpi )
- chainLength()
- 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 )
- pipe_0( dGd, dHdG)
- pipe_1( dGd, dHdG)
- pipe_2( dGd, dHdG)
- pipe_3( dGd, dHdG)
- pipe_4( dGdx, dHdG)
- pipe_5( dGdx, dHdG)
- pipe_6( dGdx, dHdG)
- pipe_7( dGdx, dHdG)
- pipe_8( dGdx, dHdG)
- pipe_9( dGdx, dHdG)
- result( xdata, param=None )
- selectPipe( ndim, ninter, ndout )
- setLimits( lowLimits=None, highLimits=None )
- setPrior( k, prior=None, **kwargs )
- shortName()
- strictNumericDerivative( xdata, param )
- strictNumericPartial( xdata, params, parlist=None )
- subtractModel( model )
- testPartial( xdata, params, silent=True )
- unit2Domain( uvalue, kpar=None )
Methods inherited from FixedModel:
Methods inherited from BaseModel:
|
|