change.pnparameters {FlexParamCurve} | R Documentation |
Change Fixed Parameter Values
Description
Function to alter values of parameters to be used by SSposnegRichards
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,
Amin = NA,
Amax = NA,
Kmin = NA,
Kmax = NA,
Imin = NA,
Imax = NA,
Mmin = NA,
Mmax = NA,
RAmin = NA,
RAmax = NA,
Rkmin = NA,
Rkmax = NA,
Rimin = NA,
Rimax = NA,
RMmin = NA,
RMmax = 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,
Envir = .GlobalEnv)
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 |
Amin |
a numeric value for the minimum bound of Asym |
Amax |
a numeric value for the maximum bound of Asym |
Kmin |
a numeric value for the minimum bound of K |
Kmax |
a numeric value for the maximum bound of K |
Imin |
a numeric value for the minimum bound of Infl |
Imax |
a numeric value for the maximum bound of Infl |
Mmin |
a numeric value for the minimum bound of M |
Mmax |
a numeric value for the maximum bound of M |
RAmin |
a numeric value for the minimum bound of RAsym |
RAmax |
a numeric value for the maximum bound of RAsym |
Rkmin |
a numeric value for the minimum bound of Rk |
Rkmax |
a numeric value for the maximum bound of Rk |
Rimin |
a numeric value for the minimum bound of Ri |
Rimax |
a numeric value for the maximum bound of Ri |
RMmin |
a numeric value for the minimum bound of RM |
RMmax |
a numeric value for the maximum bound of RM |
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 |
Envir |
a valid R environment to find pn.options in, by default this is the global environment |
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.
Value
a list
of values for all above arguments,
with new values substituted where specified in the call
Note
Requires modpar
to be have been run prior to execution
Version 1.5 saves many variables, and internal variables in the package environment:
FlexParamCurve:::FPCEnv. By default, the pn.options file is copied to the environment
specified by the functions (global environment by default). Model selection routines
also copy from FPCenv to the global environment all nlsList models fitted during
model selection to provide backcompatibility with code for earlier versions. The user
can redirect the directory to copy to by altering the Envir argument when calling the
function.
Author(s)
Stephen Oswald <steve.oswald@psu.edu>
See Also
modpar
SSposnegRichards
posnegRichards.eqn
Examples
# change all fixed values except K and Rk
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")