Skip to content

curvefit.core.parameter.Variable

A variable to be estimated during the fit

A Variable is the most detailed unit to be estimated for curve fitting. A Variable corresponds to an effect on a parameter -- and can contain a combination of both a fixed effect and random effects. A Variable needs a "covariate", but the covariate in the data can be just a column of 1's, in which case a Variable is equivalent to a Parameter. If instead the values of the "covariate" argument differ for different rows of the data, Variable multiplies the covariate to get the Parameter for that data row.

A curvefit model is made up of multiple parameters. For more information, see Parameter and ParameterSet.

Arguments

  • covariate (str): name of the covariate for this variable (corresponds to what it will be in the data that is eventually used to fit the model)
  • var_link_fun (Callable): link function for the variable
  • fe_init (float): initial value to be used in the optimization for the fixed effect
  • re_init (float): initial value to be used in the optimization for the random effect
  • re_zero_sum_std (float): standard deviation of the zero sum prior for he random effects corresponding to this variable.
  • fe_gprior (optional, List[float]): list of Gaussian priors the fixed effect where the first element is the prior mean and the second element is the prior standard deviation
  • re_gprior (optional, List[float]): list of Gaussian priors the random effect where the first element is the prior mean and the second element is the prior standard deviation
  • fe_bounds (optional, List[float]): list of box constraints for the fixed effects during the optimization where the first element is the lower bound and the second element is the upper bound
  • re_bounds (optional, List[float]): list of box constraints for the fixed effects during the optimization where the first element is the lower bound and the second element is the upper bound

Usage

from curvefit.core.parameter import Variable

var = Variable(covariate='ones', var_link_fun=lambda x: x, fe_init=0., re_init=0.)