Returns fitted values and confidence intervals for continuous functions of parameters from a fitted "gsl_nls" object.
## S3 method for class 'gsl_nls'confintd(object, expr, level =0.95, dtype ="symbolic",...)
Arguments
object: A fitted model object.
expr: An expression or character vector that can be transformed to an expression
giving the function(s) of the parameters to be evaluated. Each expression should evaluate to a numeric scalar.
level: A numeric scalar between 0 and 1 giving the level of the derived parameter confidence intervals.
dtype: A character string equal to "symbolic" for symbolic differentiation of expr with deriv, or "numeric" for numeric differentiation of expr with numericDeriv using forward finite differencing.
...: Additional argument(s) for methods
Returns
A matrix with columns giving the fitted values and lower and upper confidence limits for each derived parameter. The row names list the individual derived parameter expressions.
Details
This method assumes (approximate) normality of the errors in the model and confidence intervals are calculated using the delta method, i.e. a first-order Taylor approximation of the (continuous) function of the parameters. If dtype = "symbolic" (the default), expr is differentiated with respect to the parameters using symbolic differentiation with deriv. As such, each expression in expr must contain only operators that are known to deriv. If dtype = "numeric", expr is differentiated using numeric differentiation with numericDeriv, which should be used if expr cannot be derived symbolically with deriv.
Examples
## dataset.seed(1)n <-25xy <- data.frame( x =(1:n)/ n, y =2.5* exp(-1.5*(1:n)/ n)+ rnorm(n, sd =0.1))## modelobj <- gsl_nls(fn = y ~ A * exp(-lam * x), data = xy, start = c(A =1, lam =1))## delta method ci'sconfintd(obj, expr = c("log(lam)","A / lam"))