curvefit.core.parameter.Parameter
A parameter for the functional form of the curve
A Parameter
is a parameter of the functional form for the curve. For example, if the parametric curve you want
to fit has three parameters then you need 3 Parameter
objects. A Parameter
is made up of one or more
Variable
objects, which represent the fixed and random effects. Parameters may have
link functions that transform the parameter into some other
space to enforce, for example, positivity of the parameter (e.g. the parameter representing the scale of a
Gaussian distribution can't be negative).
Arguments
param_name (str)
: name of parameter, e.g. 'alpha'link_fun (Callable)
: the link function for the parametervariables (List[curvefit.core.parameter.Variable])
: a list ofVariable
instances
Attributes
All attributes from the Variable
s in the list in the variables
argument are carried over to
Parameter
but they are put into a list. For example, the fe_init
attribute for Parameter
is a list of
fe_init
attributes for each Variable
in the order that they were passed in variables
list.
Additional attributes that are not lists of the individual Variable
attributes are listed below.
self.num_fe (int)
: total number of effects for the parameter (number of variables)
Usage
from curvefit.core.parameter import Parameter, Variable
var = Variable(covariate='ones', var_link_fun=lambda x: x, fe_init=0., re_init=0.)
param = Parameter(param_name='alpha', link_fun=lambda x: x, variables=[var])