Methods for importanceSampling object construction in Package sampSurf

Share:

Description

The methods described below for the construction of objects of class "importanceSampling" fall into two categories as follows...

1. The object passed is a "Stem" subclass object: importance sampling is applied to the individual stem.

2. The object passed is a collection ("StemContainer") of "Stem" subclass objects: importance sampling is applied to each stem in the collection based on the other arguments passed.

In adition, there is a separate method for the case when object is of class "list". This is the base constructor that really performs all of the importance sampling code on the individual stems. The other methods are simply wrappers that call this method. The list constructor is detailed below for completeness; however, please do not use it, pass one of the other types of objects instead to use one of the other methods, this will ensure proper results inasmuch as is possible.

Methods

Each of the methods has either the same argument list, or a subset of arguments that correspond to the list signature method. Refer to that method for any arguments that have a universal interpretation over all methods.

signature(object = "downLog")

usage...

importanceSampling(object,
                   segBnds = c(low = 0,  up = object@logLen),
                   n.s = 1,
                   startSeed = NA,
                   u.s = NA,
                   proxy = 'gvProxy',
                   alphaLevel = 0.05,
                   description = 'Importance Sampling',
                   ... )
  • object: An object of class "downLog".

signature(object = "downLogs")

usage...

importanceSampling(object,
                   segBnds = NULL,
                   n.s = 1,
                   startSeed = NA,
                   u.s = NA,
                   proxy = 'gvProxy',
                   alphaLevel = 0.05,
                   description = 'Importance Sampling',
                   ... )
  • object: A container object of class "downLogs" with one or more "downLog" objects.

  • segBnds: The segment bounds, see the definition for the list method. Note: These bounds are used for all logs in the collection, so it is up to you to make sure they are legal for each log.

  • startSeed: By default, the stream is started using this seed (see below for the list method) and the current random number stream is continued for each log in the collection. This results in a different set of random numbers for each log (but all keyed off this starting value).

  • u.s: If this is NULL or NA, then the n.s and startSeed combination are used as described below for the list method. However, if this is a vector, then it is applied to each log. Therefore, the same set of random numbers will be applied to each log in the collection.

signature(object = "list")

Please do not use this method directly, use one of the others documented here that will ultimately call this method.

usage...

importanceSampling(object,
                   segBnds = c(low = 0, up = object$height),
                   n.s = 1,
                   startSeed = NA,
                   u.s = NA,
                   proxy = 'gvProxy',
                   alphaLevel = 0.05,
                   controlVariate = FALSE,
                   description = 'Monte Carlo Sampling',
                   ... )
  • object: An object of class "list".

  • segBnds: A vector of length two giving the lower and upper height/length bounds for volume estimation within the bole. These bounds correspond to the limits of integration along the bole. If either of the bounds are NULL or NA, the entire bole is used (default).

  • n.s: The number of sampled heights desired within segBnds for volume estimation.

  • startSeed: The scalar seed for the random number generator used in the call to the class constructor. Please see the documentation in initRandomSeed for possible values and their meaning.

  • u.s: The uniform random numbers used in selecting the sampling points along the bole. If this is either NULL or NA, then n.s and startSeed will be used to determine the random numbers. If this is a numeric vector, then n.s is set to its length, and u.s is used as the random number stream. No checking is done on the bounds of the numbers so be careful if using the latter option. It is most useful in antithetic sampling where the 1-u.s stream is used (automatically).

  • proxy: A character name specifying the proxy function to be used in importance sampling. See the vignette referenced in the generic for details.

  • alphaLevel: The two-tailed alpha-level for confidence interval construction.

  • controlVariate: TRUE: use control variate sampling; FALSE: either crude Monte Carlo or importance sampling, depending on the proxy passed.

  • description: A character vector description of the object.

  • ...: Arguments to be passed on to the proxy function. For collections, these apply to each stem in the collection.

signature(object = "standingTree")

usage...

importanceSampling(object,
                   segBnds = c(low = 0,  up = object@height),
                   n.s = 1,
                   startSeed = NA,
                   u.s = NA,
                   proxy = 'gvProxy',
                   alphaLevel = 0.05,
                   description = 'Importance Sampling',
                   ... )
  • object: An object of class "standingTree".

signature(object = "standingTrees")

usage...

importanceSampling(object,
                   segBnds = NULL,
                   n.s = 1,
                   startSeed = NA,
                   u.s = NA,
                   proxy = 'gvProxy',
                   alphaLevel = 0.05,
                   description = 'Importance Sampling',
                   ... )
  • object: A container object of class "standingTrees" with one or more "standingTree" objects.

  • segBnds: The segment bounds, see the definition for the list method. Note: These bounds are used for all trees in the collection, so it is up to you to make sure they are legal for each tree.

  • startSeed: By default, the stream is started using this seed (see below for the list method) and the current random number stream is continued for each tree in the collection. This results in a different set of random numbers for each tree (but all keyed off this starting value).

  • u.s: If this is NULL or NA, then the n.s and startSeed combination are used as described below for the list method. However, if this is a vector, then it is applied to each tree. Therefore, the same set of random numbers will be applied to each tree in the collection.

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.