parsetup: Parameter setup functions

Description Usage Arguments Value Examples

Description

Functions to assist in setting up parameters. To be used in creating new arrangements of parameters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
make.par(Day, new.par, default.par)

parsetup.full(Day, alpha, r, pi, M, noise)

parsetup.default(Day, type = c("dilution", "incorporation", "full"), ...)

parsetup.dilution(Day, alpha = c("one", "many"), M = c("none", "one",
  "many"))

parsetup.incorporation(Day, alpha = c("many", "log2k", "log2kplateau", "k",
  "kplateau"), M = c("none", "one", "many"))

Arguments

Day

A vector of the days that the data were taken. It's processed using unique, so duplicates can either be included or not.

new.par

A list of additional parameters used to set up the column in the parameter matrix for each parameter.

type:

Takes the values "one", "many", or "none". The value "one" sets this parameter equal for all days. The value "many" allows it to be different for all days. The value "none" sets it to NA.

start:

The starting value for the optimization. Can be set either as a numeric value or as a function which takes the day as a single parameter.

default:

The default value for the parameter, for all days (except possibly the first day, see default0). Used when the parameter should not be optimized. Leave missing if the parameter should be optimized over.

default0:

The default value for the parameter for the first day (usually day 0). If missing, the default as set in default is used. Set equal to null to set to NA.

lower:

The lower bound for the optimization. Can be set either as a numeric value or as a function which takes the day as a single parameter.

upper:

The upper bound for the optimization. Can be set either as a numeric value or as a function which takes the day as a single parameter.

default.par

Default values for the parameters as described in new.par

alpha

For parsetup.full, a list of additional parameters for alpha, suitable for passing to make.par. See new.par below. Defaults are type = "one", start = 0.2, lower = 0.001, and upper = 0.999. For parsetup.default, only the desired type can be set.

r

For parsetup.full, a list of additional parameters for r, suitable for passing to make.par. See new.par below. Defaults are type = "many", start = a function to give a suitable starting value for each day separately, lower = 0.001, upper = 0.999, and default0 = 0. Cannot be changed using parsetup.default.

pi

For parsetup.full, a list of additional parameters for pi, suitable for passing to make.par. See new.par below. Defaults are type = "many", start = a function to give a suitable starting value for each day separately, lower = 0.001, and upper = 0.999. Cannot be changed using parsetup.default.

M

For parsetup.full, a list of additional parameters for pi, suitable for passing to make.par. See new.par below. Defaults are type = "none", start = 4, lower = 0.001, and upper = Inf. For parsetup.default, only the desired type can be set.

noise

For parsetup.full, a list of additional parameters for noise, suitable for passing to make.par. See new.par below. Defaults are type = "many", start = a function to give a suitable starting value for each day separately, lower = 0.001, and upper = 0.999. Cannot be changed using parsetup.default. This parameter is currently ignored in the model fitting.

type

Sets default function to either parsetup.dilution or parsetup.incorporation

...

Additional items to be passed along.

Value

A list with the following elements:

par

A dataframe with the starting value, upper bound, and lower bound for each parameter to be optimized over.

days

A vector containing the unique days that were input, sorted in increasing order.

parmatrix

A function to convert a vector of parameters to a matrix suitable for passing to the fitting function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# With all default parameters
p <- parsetup.default(0:3)
p$parmatrix(p$par$start)
 
# With many alphas and one M 
p <- parsetup.default(0:3, alpha="many", M="one")
p$parmatrix(p$par$start)
 
# Forcing r to be 1 for all days
p <- parsetup.full(0:3, r=list(default=1, default0=1))
p$parmatrix(p$par$start)

HegemanLab/ProteinTurnover documentation built on May 6, 2019, 11:50 p.m.