Learn R Programming

FlexParamCurve (version 1.4-3)

change.pnparameters: Change Fixed Parameter Values

Description

Function to alter values of parameters to be used by SSposnegRichards or posnegRichards.eqn as the fixed values in equations where parameters are fixed

Usage

change.pnparameters(Asym = NA,

K = NA,

Infl = NA,

M = NA,

RAsym = NA,

Rk = NA,

Ri = NA,

RM = NA,

first.y = NA,

x.at.first.y = NA,

last.y = NA,

x.at.last.y = NA,

twocomponent.x = NA,

verbose = NA,

force4par = NA,

pn.options)

Arguments

Asym
a numeric value for the asymptote of the positive (increasing) curve
K
a numeric value for the rate parameter of the positive (increasing) curve
Infl
a numeric value for the point of inflection of the positive (increasing) curve
M
a numeric value for the shape parameter of the positive (increasing) curve
RAsym
a numeric value for the asymptote of the negative (decreasing) curve
Rk
a numeric value for the rate parameter of the negative (decreasing) curve
Ri
a numeric value for the point of inflection of the negative (decreasing) curve
RM
a numeric value for the shape parameter of the negative (decreasing) curve
first.y
the value of y at minimum x when it is required to be constrained
x.at.first.y
the final value of x - 0 value is used if not specified when last.y is not NA
last.y
the value of y at maximum x when it is required to be constrained
x.at.last.y
the final value of x - this is option is currently disabled
twocomponent.x
a numerical specifying the x-value (e.g. age) of intersection if a double model of two separate components is to be fitted. Alternatively a logical of value = TRUE if the same type of model is to be fitted but the x of intersection is unknown
verbose
logical indicating whether information on successful optimization and parameters should be returned during when using SSposnegRichards
force4par
logical specifying whether parameters of the negative Richards should be ignored - effectively using simple Richards curve
pn.options
required character string specifying the name of a list object currently populated with starting parameter estimates, fitting options and bounds to be modified

Value

  • a list of values for all above arguments, with new values substituted where specified in the call

Details

This function provides a simple way for the user to update the a user-named list that holds fixed values and options for fitting and solving positive-negative Richards curves with SSposnegRichards and posnegRichards.eqn, respectively. Running this function also concurrently updates the parameterbounds in the same list which are vthe maximum and minimum values for parameters to be used by optim and nls during parameter estimation in SSposnegRichards. The list is written automatically by the function but it is also output as a return value for assignation in the usual way [myoptions<- change.pnparameters(...)]. The list specified by pn.options must exist before this function is called. Use modpar to estimate values for all parameters and easily generate a suitable list. See modpar for details of bounding.

See Also

modpar SSposnegRichards posnegRichards.eqn

Examples

Run this code
# change all fixed values except K and Rk

    data(posneg.data)

    modpar(posneg.data$age, posneg.data$mass, pn.options = "myoptions")

    change.pnparameters(Asym = 10000, Infl = 80, M = 5, RAsym = 10000, 

        Ri = 240, RM = 5, pn.options = "myoptions")



# change fixed values of M and constrain hatching mass to 45.5 in a growth curve

    change.pnparameters(M = 1, RM = 0.5, first.y = 45.5, pn.options = "myoptions")

Run the code above in your browser using DataLab