class FreeShapeModel( LinearModel ) | Source |
---|
Pixelated Model.
f( x:p ) = p( expanded )
where p is a array of amplitudes of the same size as the input x divided by the number of pixels per bin ( ppb ). When ppb > 1, each p has a shape which is used to fill the pixels of the bin. Initially the shape is a top-hat, which can be autoconvolved.
By default ppb = 5.
The parameters are initialized at 0.
Although this is a LinearModel it will not work very well with the ( linear ) Fitter. It will be a very ill-posed problem.
Using NestedSampler its exponential prior will ensure that all parameters are kept positive.
Attributes
- npix : int
Number of pixels in result. Is also npar. - xlo : float ( default 0 )
Lowest value in xdata - xhi : float ( default npix )
Highest value in xdata
xlo and xhi define the valid domain of the model.
All input data must be: xlo <= xdata <= xhi - shape : Kernel
shape of convolving function - center : float (between 0..1)
position of the center of shape with respect to the pixels
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
nn = 100
fsm = FreeShapeModel( nn, nconvolve=4, xlo=-1.0, xhi=4.0 )
print( fsm.shape )
Author Do Kester
FreeShapeModel( npix, copy=None, shape=None, nconvolve=0, center=0.5, xlo=0.0, xhi=None, **kwargs ) |
---|
Free Shape model with npix pixels.
The number of parameters equals the number of pixels
Parameters
- npix : int
number of pixels = npar - copy : FreeShapeModel
model to be copied - shape : None or Kernel
None : Use Tophat(), convolved nconvolve times.
Kernel : use the kernel as shape; nconvolve does not apply. - nconvolve : int
number of (auto)convolutions on Tophat - center : float (between 0..1)
positions where the pixels are centered.
default: 0.5 -> pixels run from k to k+1 - xlo : float ( default 0.0 )
lowest value in xdata - xhi : float ( default np )
highest value in xdata
copy( ) |
---|
checkDomain( xdata ) |
---|
Parameters
- xdata : array_like
value at which to calculate the result
Raises
ValueError when outside domain.
baseResult( xdata, params ) |
---|
Parameters
- xdata : array_like
value at which to calculate the result - params : array_like
values for the parameters
basePartial( xdata, params, parlist=None ) |
---|
Parameters
- xdata : array_like
value at which to calculate the result - params : array_like
values for the parameters
TBCbaseDerivative( xdata, params ) |
---|
Parameters
- xdata : array_like
value at which to calculate the result - params : array_like
values for the parameters
baseName( ) |
---|
baseParameterUnit( k ) |
---|
Parameters
- k : int
parameter number.
Methods inherited from LinearModel |
---|
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 )
- partial( 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( )
- isMixed( )
- 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 |
---|