Description Usage Arguments Value Examples
View source: R/unite_and_fit_function.R
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
).
1 | unite.and.fit(par, no.fit, par.names, fit.fn, ...)
|
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 |
... |
Other arguments. |
Returns the negative log-likelihood as calculated by the specified cost function
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.