class ProductModel( NonLinearModel ) | Source |
---|
Direct product of 2 (or more) models.
The dimensionality of this model is equal to the number of constituent models.
The number of parameters is the sum of the parameters of the models.
Examples
nxk = 17
nyk = 11
xknots = numpy.arange( nxk , dtype=float ) * 10 # make knots from 0 to 160
yknots = numpy.arange( nyk , dtype=float ) * 10 # make knots from 0 to 100
smx = SplinesModel( xknots )
smy = SplinesModel( yknots )
csm = ProductModel( [smx,smy] )
print csm.getNumberOfParameters( ) # ( nxk + order - 1 ) + ( nyk + order - 1 )
32
# ... fitter etc. see Fitter
Category mathematics/Fitting
Attributes
- models : list of Model
models to be multiplied, one for each dimension.
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
ProductModel( models, copy=None, fixed=None, **kwargs ) |
---|
Direct product of 2 (or more) models. It has dimensionality equal to the number of constituent models.
The models are given as input, the consecutive colums in xdata.
The number of parameters is the sum of the parameters of the constituent models
Parameters
- models : list of Model
the constituent models - copy : ProductModel
model to be copied - fixed : dict
If not None raise AttributeError.
Raises
ValueError
When one of the models is 2 (ore more) dimensional
- AttributeErrr : When fixed is not None
copy( ) |
---|
baseResult( xdata, params ) |
---|
The partials are the powers of x (input) from 0 to degree.
Parameters
- xdata : array_like
value at which to calculate the partials - params : array_like
parameters to the model.
basePartial( xdata, params, parlist=None ) |
---|
The partials are the powers of x (input) from 0 to degree.
Parameters
- xdata : array_like
value at which to calculate the partials - params : array_like
parameters to the model. - parlist : array_like
not used in this model
baseName( ) |
---|
baseParameterName( k ) |
---|
- k : int
the kth parameter.
baseParameterUnit( k ) |
---|
- k : int
the kth parameter.
Methods inherited from NonLinearModel |
---|
Methods inherited from Model |
---|
- chainLength( )
- isNullModel( )
- isolateModel( k )
- addModel( model )
- subtractModel( model )
- multiplyModel( model )
- divideModel( model )
- pipeModel( model )
- appendModel( model, operation )
- correctParameters( params )
- result( xdata, param=None )
- operate( res, pars, next )
- derivative( xdata, param, useNum=False )
- selectPipe( ndim, ninter, ndout )
- 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 )
- shortName( )
- getNumberOfParameters( )
- numDerivative( xdata, param )
- numPartial( xdata, param )
- isDynamic( )
- hasPriors( isBound=True )
- getPrior( kpar )
- setPrior( kpar, prior=None, **kwargs )
- getParameterName( kpar )
- getParameterUnit( kpar )
- getIntegralUnit( )
- setLimits( lowLimits=None, highLimits=None )
- getLimits( )
- hasLimits( fitindex=None )
- unit2Domain( uvalue, kpar=None )
- domain2Unit( dvalue, kpar=None )
- partialDomain2Unit( dvalue )
- nextPrior( )
- getLinearIndex( )
- testPartial( xdata, params, silent=True )
- strictNumericPartial( xdata, params, parlist=None )
- assignDF1( partial, i, dpi )
- assignDF2( partial, i, dpi )
- strictNumericDerivative( xdata, param )
Methods inherited from FixedModel |
---|
Methods inherited from BaseModel |
---|