Choose a Package
np, npRmpi, crs, choose a package, kernel methods, splines
If you are deciding where to begin, the short answer is this: start with the package that matches the job, not with the longest document.
| If you want to… | Start with | Why |
|---|---|---|
| Fit kernel regression, density, distribution, or related tests on one machine | np |
This is the core package and the natural starting point for most users. |
| Run the same style of kernel workflows on larger jobs using MPI | npRmpi |
The package supports a modern session route on macOS/Linux and attach under mpiexec when that is the appropriate entry path. |
| Work with categorical regression splines and related constrained spline methods | crs |
This package is the right entry point for spline-based work rather than kernel-based work. |
A practical rule of thumb
- Start with
npunless you already know that you need MPI. - Move to
npRmpiwhen the workflow is the same but the job is too large or too slow in serial. - Use
crswhen spline bases, shape restrictions, or spline-specific methods are the natural fit.
Current Capabilities
- Runtime, Memory, and Scaling:
npandnpRmpi0.80-1standardize bootstrap, uncertainty, and dotted plotting controls; retain prepared samples for safer bandwidth-object reuse; add simultaneous variability bands across the principal estimator families; support factor predictors in single-index models; and strengthen bounded-kernel, nearest-neighbour, scaled-bandwidth, plotting, and serial/MPI behavior. - Splines:
crs0.15-46retains the common named plotting controls andcrshat()operator workflow, adds formula/data and S3 support for instrumental spline regression, and provides the observed NOMAD interface used by downstream degree searches. - Kernel Methods:
npandnpRmpisupport local polynomial capability across the conditional family, together with joint degree and bandwidth selection for mixed data, gradient support throughout the conditional estimators, and derivative estimation of arbitrarily high order, limited only by the selected polynomial degree whether set manually or chosen automatically for the underlying smoothness class. - Density, Distribution, Quantiles: boundary-aware unconditional and conditional density routes cover known two-sided or one-sided bounds and practical unknown-bound proxies, with a dedicated worked example for finite- and unbounded-support settings.
- Density, Distribution, Quantiles:
nplsqregandnplsqregbwprovide a first-class location-scale quantile workflow, with formula and bandwidth-object routes, scalar or vectortau, stored-quantile prediction selection, residuals, summaries, plot routes, and the same NOMAD-enabled LP search style where supported. - Density, Distribution, Quantiles:
npqregis a first-class estimator with direct formula support, automaticnpcdistbw()selection whenbwsis omitted, vectortau, gradients, standard errors, andnomad = "auto"pass-through for local-polynomial degree-and-bandwidth search. - Classification and Modes:
npconmodeis a first-class estimator with direct formula/data/newdata routes, automaticnpcdensbw()selection whenbwsis omitted, probability and gradient support, mirrored degree/search metadata, andnomad = "auto"pass-through for local-polynomial degree-and-bandwidth search. - Density, Distribution, Quantiles:
npcopulais a first-class estimator with a direct formula interface, automaticnpudistbw()ornpudensbw()selection whenbwsis omitted, and automatic two-dimensional probability-grid construction for the default copula grid route. - Semiparametric Models:
npreghat,npindexhat,npplreghat, andnpscoefhatsimplify constrained nonparametric and semiparametric estimation through one-call hat-matrix operator routes, whilenpudenshat,npudisthat,npcdenshat, andnpcdisthatextend the same operator style to the density/distribution family. - Plotting and Intervals: pointwise, Bonferroni, and simultaneous variability bounds share the plotting surface across supported regression, density/distribution, quantile, class-probability, and copula targets, and
band = "all"shows all three together. - Plotting and Intervals:
renderer = "rgl"supports interactive 3D rotation/zoom whenrglis installed, whiledata.ruganddata.overlaymanage rugs and observed-data overlays on supported routes. - MPI and Large Data:
npRmpisession and attach routes makenpandnpRmpicode directly interchangeable, while preserving the profile route for users who want it.
Common routes
I want a simple first success
Go to Install and Get Started, install the package you need, and then use Quickstarts for the smallest runnable scripts before worrying about longer documents.
I already know I want kernel methods
Go to Kernel Methods. That page starts with np and then points you to npRmpi when parallel execution is warranted.
I already know I need MPI
Go directly to MPI and Large Data. The guidance there is organized around current session, attach, and profile usage rather than the older wrapper-heavy style.
I want working scripts
Go first to Quickstarts if you want the shortest path to runnable code. Then use Code Catalog, Worked Examples, or Interactive Demos when you want more context or a broader script library.
First commands to remember
## Install the two serial packages directly from CRAN
install.packages("np")
install.packages("crs")For npRmpi, installation depends on your MPI setup and operating system, so it is treated separately on MPI and Large Data.