Function to alter values of parameters to be used by SSposnegRichards
or posnegRichards.eqn
as the fixed values in equations where parameters are fixed
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)
a list
of values for all above arguments,
with new values substituted where specified in the call
a numeric value for the asymptote of the positive (increasing) curve
a numeric value for the rate parameter of the positive (increasing) curve
a numeric value for the point of inflection of the positive (increasing) curve
a numeric value for the shape parameter of the positive (increasing) curve
a numeric value for the asymptote of the negative (decreasing) curve
a numeric value for the rate parameter of the negative (decreasing) curve
a numeric value for the point of inflection of the negative (decreasing) curve
a numeric value for the shape parameter of the negative (decreasing) curve
a numeric value for the minimum bound of Asym
a numeric value for the maximum bound of Asym
a numeric value for the minimum bound of K
a numeric value for the maximum bound of K
a numeric value for the minimum bound of Infl
a numeric value for the maximum bound of Infl
a numeric value for the minimum bound of M
a numeric value for the maximum bound of M
a numeric value for the minimum bound of RAsym
a numeric value for the maximum bound of RAsym
a numeric value for the minimum bound of Rk
a numeric value for the maximum bound of Rk
a numeric value for the minimum bound of Ri
a numeric value for the maximum bound of Ri
a numeric value for the minimum bound of RM
a numeric value for the maximum bound of RM
the value of y at minimum x when it is required to be constrained
the final value of x - 0 value is used if not specified when last.y is not NA
the value of y at maximum x when it is required to be constrained
the final value of x - this is option is currently disabled
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
logical indicating whether information on successful optimization and
parameters should be returned during when using SSposnegRichards
logical specifying whether parameters of the negative Richards
should be ignored - effectively using simple Richards curve
required character string specifying the name of a list object currently
populated with starting parameter estimates, fitting options and bounds to be modified
a valid R environment to find pn.options in, by default this is the global environment
Stephen Oswald <steve.oswald@psu.edu>
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.
modpar
SSposnegRichards
posnegRichards.eqn
# 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")
Run the code above in your browser using DataLab