deerlab.lincombine

lincombine(*inputmodels, addweights=False)[source]

Create model whose response is a linear combination of multiple individual model responses.

Parameters:
inputmodelsdeerlab.Model objects

Model objects whose linear responses are to be linearly combined. If one of the models has no linear parameters, a linear scaling factor parameters will be added. The names of the N-th input model parameter will be changed by a suffix _N in the new model. Example:

newmodel = lincombine(model1,model2)
newmodel.parA_1 # Originally parA from model1
newmodel.parA_2 # Originally parA from model2
addweightsboolean, optional

If true, the function will add a non-linear weight parameter for each model response even if the individual models have linear parameters.

Returns:
newmodeldeerlab.Model

New model object taking the combined parameter set and returning a response that is a linear combination of the input models.