Learn R Programming

FlexParamCurve (version 1.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_age = NA,

verbose = NA,

force4par = NA)

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_age
a numerical specifying the 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 age 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

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 object $pnmodelparams$ that holds fixed values and options for fitting and solving positive-negative Richards curves with SSposnegRichards and posnegRichards_eqn, respectively. Running this function concurrently updates the object $pnmodelparamsbounds$ which holds the maximum and minimum values for parameters to be used by optim and nls during parameter estimation in SSposnegRichards. These objects are updated globally and do not need to be assigned by the user: the output of a return value simply offers a way to save values elsewhere for posterity. Both objects must exist before this function is called. Use modpar to estimate values for all parameters and create $pnmodelparams$ and $pnmodelparamsbounds$. 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)

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

        Ri = 240, RM = 5)



# 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)

Run the code above in your browser using DataLab