confint.gsl_nls | R Documentation |
Returns asymptotic or profile likelihood confidence intervals for the parameters in a
fitted "gsl_nls"
object.
## S3 method for class 'gsl_nls'
confint(object, parm, level = 0.95, method = c("asymptotic", "profile"), ...)
object |
An object inheriting from class |
parm |
A character vector of parameter names for which to evaluate confidence intervals, defaults to all parameters. |
level |
A numeric scalar between 0 and 1 giving the level of the parameter confidence intervals. |
method |
Method to be used, either |
... |
At present no optional arguments are used. |
Method "asymptotic"
assumes (approximate) normality of the errors in the model and calculates
standard asymptotic confidence intervals based on the quantiles of a t-distribution. Method "profile"
calculates profile likelihood confidence intervals using the confint.nls
method
in the MASS package and for this reason is only available for "gsl_nls"
objects that
are also of class "nls"
.
A matrix with columns giving the lower and upper confidence limits for each parameter.
confint
, confint.nls
in package MASS.
## data
set.seed(1)
n <- 25
xy <- data.frame(
x = (1:n) / n,
y = 2.5 * exp(-1.5 * (1:n) / n) + rnorm(n, sd = 0.1)
)
## model
obj <- gsl_nls(fn = y ~ A * exp(-lam * x), data = xy, start = c(A = 1, lam = 1))
## asymptotic ci's
confint(obj)
## Not run:
## profile ci's (requires MASS)
confint(obj, method = "profile")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.