10.07.2015 Views

The np Package - NexTag Supports Open Source Initiatives

The np Package - NexTag Supports Open Source Initiatives

The np Package - NexTag Supports Open Source Initiatives

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16 <strong>np</strong>cdensgradientsarguments will need to be supplied as necessary to specify the bandwidth type,kernel types, training data, and so on.a logical value specifying whether to return estimates of the gradients at theevaluation points. Defaults to FALSE.... additional arguments supplied to specify the bandwidth type, kernel types, andso on. This is necessary if you specify bws as a p+q-vector and not a conbandwidthobject, and you do not desire the default behaviours. To do this, you may specifyany of bwmethod, bwscaling, bwtype, cxkertype, cxkerorder,cykertype, cykerorder, uxkertype, uykertype, oxkertype, oykertype,as described in <strong>np</strong>cdensbw.datanewdatatxdattydatexdateydatan optional data frame, list or environment (or object coercible to a data frame byas.data.frame) containing the variables in the model. If not found in data,the variables are taken from environment(bws), typically the environmentfrom which <strong>np</strong>cdensbw was called.An optional data frame in which to look for evaluation data. If omitted, thetraining data are used.a p-variate data frame of sample realizations of explanatory data (training data).Defaults to the training data used to compute the bandwidth object.a q-variate data frame of sample realizations of dependent data (training data).Defaults to the training data used to compute the bandwidth object.a p-variate data frame of explanatory data on which conditional densities will beevaluated. By default, evaluation takes place on the data provided by txdat.a q-variate data frame of dependent data on which conditional densities will beevaluated. By default, evaluation takes place on the data provided by tydat.Details<strong>np</strong>cdens and <strong>np</strong>cdist implement a variety of methods for estimating multivariate conditionaldistributions (p + q-variate) defined over a set of possibly continuous and/or discrete (unordered,ordered) data. <strong>The</strong> approach is based on Li and Racine (2004) who employ ‘generalized productkernels’ that admit a mix of continuous and discrete datatypes.Three classes of kernel estimators for the continuous datatypes are available: fixed, adaptive nearestneighbor,and generalized nearest-neighbor. Adaptive nearest-neighbor bandwidths change witheach sample realization in the set, x i , when estimating the density at the point x. Generalizednearest-neighbor bandwidths change with the point at which the density is estimated, x. Fixedbandwidths are constant over the support of x.Training and evaluation i<strong>np</strong>ut data may be a mix of continuous (default), unordered discrete (tobe specified in the data frames using factor), and ordered discrete (to be specified in the dataframes using ordered). Data can be entered in an arbitrary order and data types will be detectedautomatically by the routine (see <strong>np</strong> for details).A variety of kernels may be specified by the user. Kernels implemented for continuous datatypesinclude the second, fourth, sixth, and eighth order Gaussian and Epanechnikov kernels, and theuniform kernel. Unordered discrete datatypes use a variation on Aitchison and Aitken’s (1976)kernel, while ordered datatypes use a variation of the Wang and van Ryzin (1981) kernel.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!