combine.par: Combine Fitted and Non-fitted Parameters

Description Usage Arguments Value Examples

View source: R/combine_par_function.R

Description

Combines fitted and non-fitted parameters into a single vector, taking into account the specified default values.

Usage

1
combine.par(fit.par, all.names, default.val = NULL)

Arguments

fit.par

A named vector containing all parameters that are supposed to be fitted.

all.names

A vector containing the names of all parameters (fitted and non-fitted).

default.val

A named list containing the values that the non-fitted parameters should take. If NULL, all non-fitted parameters will be set to zero. Default values can be either given by a numeric value or by the name of the corresponding parameter the value should be inherited from (NOTE: If a string is supplied, the corresponding parameter entry has to contain a numeric value). Default to NULL.

Value

A named vector containing the elements of fit.par and the non-fitted parameters, in the order given by all.names. The non-fitted parameters are determined by the remaining names in all.names and their values are set according to default.val.

Examples

1
2
3
4
5
6
7
8
#set parameters, names and default values
fits <- c(p1 = 3, p4 = -2)
par.names <- c("p1", "p2", "p3", "p4", "p5")
defaults <- list(p1 = 4, p2 = 10, p3 = "p1", p4 = 0, p5 = "p4")

#combine the parameters in different ways
combine.par(fit.par = fits, all.names = par.names)
combine.par(fit.par = fits, all.names = par.names, default.val = defaults)

FAMoS documentation built on May 26, 2019, 5 p.m.