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.
Recent Extensions
- Kernel Methods:
npandnpRmpinow expose 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: bounded-kernel conditional density and distribution routes are now available when support bounds are known or when practical unknown-bound proxies are appropriate, and
proper = TRUEnow supports proper LP conditional density/distribution estimates when degree exceeds zero. - Density, Distribution, Quantiles:
npqregnow behaves like a first-class estimator, with direct formula support, automaticnpcdistbw()selection whenbwsis omitted, vectortau, gradients, standard errors, andnomad = TRUEpass-through for local-polynomial degree-and-bandwidth search. - Classification and Modes:
npconmodeis now a first-class estimator too, with direct formula/data/newdata routes, automaticnpcdensbw()selection whenbwsis omitted, probability and gradient support, mirrored degree/search metadata, andnomad = TRUEpass-through for local-polynomial degree-and-bandwidth search. - Density, Distribution, Quantiles:
npcopulais now a first-class estimator too, 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, andnpscoefhatnow simplify constrained nonparametric and semiparametric estimation by exposing one-call hat-matrix operator routes in place of much of the older manual matrix-construction workflow, whilenpudenshat,npudisthat,npcdenshat, andnpcdisthatextend the same operator style to the density/distribution family. - Worked Examples: Bonferroni and simultaneous variability bounds are new plotting additions, and
band = "all"now shows them jointly with the traditional pointwise bounds. - Plotting and Intervals:
renderer = "rgl"now supports interactive 3D rotation/zoom whenrglis installed, whiledata_ruganddata_overlaymanage rugs and observed-data overlays on supported routes. - MPI and Large Data:
npRmpiis no longer confined to the older profile/manual-broadcast interface; currentsessionandattachroutes makenpandnpRmpicode much more 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.