View source: R/bootstrap.nlsfit.R
simple.nlsfit | R Documentation |
NLS fit with without bootstrap
simple.nlsfit(fn, par.guess, y, x, errormodel, priors = list(param = c(), p = c(), psamples = c()), ..., lower = rep(x = -Inf, times = length(par.guess)), upper = rep(x = +Inf, times = length(par.guess)), dy, dx, CovMatrix, boot.R = 0, gr, dfn, mask, use.minpack.lm = TRUE, error = sd, maxiter = 500, success.infos = 1:3, relative.weights = FALSE, na.rm = FALSE)
fn |
|
par.guess |
initial guess values for the fit parameters. |
y |
the data as a one-dimensional numerical vector to be described by the fit function. |
x |
values of the explaining variable in form of a one-dimensional numerical vector. |
errormodel |
Either "yerrors" or "xyerrors", depending on the x-values having errors or not. |
priors |
List possessing the elements |
... |
Additional parameters passed to |
lower |
Numeric vector of length |
upper |
Numeric vector of length |
dy, dx |
Numeric vector. Errors of the dependent and independent variable, respectively. These do not need to be specified as they can be computed from the bootstrap samples. In the case of parametric bootstrap it might would lead to a loss of information if they were computed from the pseudo-bootstrap samples. They must not be specified if a covariance matrix is given. |
CovMatrix |
complete variance-covariance matrix of dimensions
|
boot.R |
If larger than 0, |
gr |
|
dfn |
|
mask |
logical or integer index vector. The mask is applied to select the observations from the data that are to be used in the fit. It is applied to |
use.minpack.lm |
use the |
error |
Function that takes a sample vector and returns the error estimate. This is a parameter in order to support different resampling methods like jackknife. |
maxiter |
integer. Maximum number of iterations that can be used in the optimization process. |
success.infos |
integer vector. When using |
relative.weights |
are the errors on y (and x) to be interpreted as relative weights instead of absolute ones? If TRUE, the covariance martix of the fit parameter results is multiplied by chi^2/dof. This is the default in many fit programs, e.g. gnuplot. |
na.rm |
logical. If set to |
Returns an object of class bootstrapfit
, see bootstrap.nlsfit.
Other NLS fit functions:
bootstrap.nlsfit()
,
parametric.bootstrap.cov()
,
parametric.bootstrap()
,
parametric.nlsfit.cov()
,
parametric.nlsfit()
,
plot.bootstrapfit()
,
predict.bootstrapfit()
,
print.bootstrapfit()
,
summary.bootstrapfit()
## Declare some data. value <- c(0.1, 0.2, 0.3) dvalue <- c(0.01, 0.01, 0.015) x <- c(1, 2, 3) dx <- c(0.1, 0.1, 0.1) fn <- function (par, x, ...) par[1] + par[2] * x fit.result <- simple.nlsfit(fn, c(1, 1), value, x, "xyerrors", dy=dvalue, dx=dx) summary(fit.result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.