Skip to contents

This function updates the parameters of a model object. It accepts a named vector of new parameters and uses the replace_values helper function to merge these into the existing or default parameters, preserving other values and their order.

Usage

set_pars(model, new_pars = NULL, default_pars = model$getPars())

Arguments

model

A model object that has getPars() and setPars() methods (e.g., a rodeo model object).

new_pars

A named vector of new parameter values to set. Its names should correspond to parameters in the model. If NULL, no parameters are changed beyond default_pars.

default_pars

An optional named vector representing the default parameters. If not provided, model$getPars() will be used as the base onto which new_pars are applied.

Value

The modified model object with updated parameters.