get.profile: Create Profile Likelihood Data Frame

Description Usage Arguments Value Examples

View source: R/get_profile_function.R

Description

Given previously calculated profile values by create.profile, get.profile merges the results together into a data frame.

Usage

1
2
get.profile(which.par, range, homedir = getwd(), delete.old = FALSE,
  save.it = TRUE)

Arguments

which.par

The names of the parameter that the profile should be returned for.

range

A numeric vector determining the values for which the profile should be calculated. Alternatively, setting it to "get.all" retrieves all available profile values and binds them together.

homedir

The directory in which the folder "Profile-Results" is found. Default to getwd().

delete.old

Logical. If TRUE, the individual point-wise fits created by point.profile will be deleted after using them. Default to FALSE.

save.it

Logical. If TRUE (default), the gathered data will be bound and saved in the "Profile-Results/Tables/" folder.

Value

A data frame containing the negative log-likelihood and the fitted parameter values for a specific range created by create.profile.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#define cost function
cost_function <- function(parms){
y <- parms[1] + parms[2]*c(1:3) + parms[3]*sin(c(1:3))
LL <- sum((y - c(1:3))^2)
}

#create profile values
create.profile(which.par = "get.p1",
               par.names = c(get.p1 = 1, get.p2 = 3, get.p3 = -2),
               range = list(seq(0,5,1)),
               fit.fn = cost_function,
               future.off = TRUE)

#retrieve the calculated profile
res <- get.profile(which.par = "get.p1", range = seq(0,5,1))

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