unite.and.fit: Combine Fitted and Non-fitted Parameters

Description Usage Arguments Value Examples

View source: R/unite_and_fit_function.R

Description

Combines fitted and non-fitted parameters and calls the fitting function. Serves as a wrapping function for the user-specified fitting function fit.fn (see create.profile).

Usage

1
unite.and.fit(par, no.fit, par.names, fit.fn, ...)

Arguments

par

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

no.fit

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

par.names

The names of all parameters

fit.fn

The cost function (see create.profile for more details).

...

Other arguments.

Value

Returns the negative log-likelihood as calculated by the specified cost function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#set parameters and cost function
fit.par <- c(p1 = 2, p2 = 4)
name.par <- c("p1", "p2", "p3")
defaults <- list(p1 = 0, p2 = 2, p3 = 4)
cost.function <- function(parms){
    parms[1] + parms[2] + parms[3]
}

#call unite.and.fit
unite.and.fit(par = fit.par, no.fit = c(p3 = 1),par.names = name.par, fit.fn = cost.function)

GabelHub/ProfileIroning documentation built on May 17, 2019, 12:49 p.m.