rexnls2 - Series of Non-linear Regressions


On to:
DESCRIPTION
USAGE
REQUIRED-ARGUMENTS
OPTIONAL-ARGUMENTS
VALUE
CONSTRAINTS
NOTE
SEE-ALSO
EXAMPLE



DESCRIPTION:

Intended to process series of non-linear regressions when only the values of the independent variables or their weighting values change.

For example, it is especially convenient for processing estimations by the method usually called "jackknife": affecting null weight to an observation suppresses it from the analysis.


USAGE:
rexnls2_function(nls2.object, data, 
      sv.fitted=T, sv.as.var=F, sv.B.varZ.B=F,
	     sv.correlation=F, sv.data=T, sv.est.eq=T, 
             sv.estim=T, sv.deriv.fct=T,
	     sv.mu=F, sv.residuals=F, sv.num.res=T, sv.odes=T, sv.W=F, sv.Z=F,
      sv.steps=seq(1, nls2.object$nb.steps))


REQUIRED ARGUMENTS:
nls2.object
an object of class `nls2' which has been previously created in the current S-session. In the call to `nls2', argument `renls2' must be have been set to TRUE.
data
the new data-frame.

Sommaire

OPTIONAL ARGUMENTS:

the components with prefix ".sv"
components for selecting optional results : see nls2.control.
sv.steps
in case of estimation by several steps, integer or vector of integers which specifies the steps for which results should be returned. By default, all results of all steps are returned.

VALUE:

An `nls2.object'.


CONSTRAINTS:

The number of observations should remain the same during a series of calls. It should be equal to the number of observations in the argument `nls2.object'. (In particular, be careful if you change weighting values: the same weight must be affected to all the replications of each observation and remember that a null weight substracts one from the number of observations).


NOTE:

After a series of calls, invoke `delnls2' to delete the internal data-structures created by the C-package that carries out the calculations. If this is not done, the system might run out of memory if `nls2' is called again in the same S-session.


Sommaire

SEE ALSO:




EXAMPLE:
#The following function, called "xnls2", 
#returns the successive values of "rss"
#by removing one observation each time.
xnls2_function()
{
    # Create the nls2.object: all the observations, 
    # except from the first one, are included in 
    # the analysis:
    data$weights_c(0,rep(1, (nrow(data)-1)))
    # the "freq" option of the "control" argument is used 
    # to suppress all printing. Otherwise, intermediate 
    # results will appear each successive estimations.
    nls2.out<-nls2(data, model, stat.ctx,
                   control=list(freq=0), renls2=T)


# Initialisations of the successive estimations: # the S-option "warn" is used to prevent the same # warnings from appearing each successive estimations. options(warn=-1) # Build a matrix for storing the weighting values; # so the S-command "apply" can be used: iobs_matrix(2:nrow(data), ncol=1) # Reinsert the first observation into the analysis: data$weights[1]_1 rss_ apply(iobs, 1, onexrenls2, nls2.out, data) # Delete the internal structures that are no more useful: delnls2() return(c(nls2.out$rss,rss)) }

#The "onexrenls2" function processes each call to "rexnls2": onexrenls2_function(i, nls2.out, data) { # the observation i is removed: data$weights[i]_0 return(rexnls2(nls2.out,data, sv.num.res=T)$rss) }

Sommaire


- Mon Sep 30 1996 -