np/npRmpi

Demos for functions in np/npRmpi

The following examples are a few of the demos included with the npRmpi package. These all use simulated data and were written to demonstrate how one modifies calls to functions in the np package in order to run them in parallel using the npRmpi package. The files *_serial.R are the standard (i.e. single core) versions that are run with the np package. The files *_npRmpi.R are the parallel versions (i.e. multi core) that are run with the npRmpi package. Note that you must install the np package (and optionally npRmpi) in order to run these examples, and you need a functioning MPI implementation in order to run the latter (see my website for further information about installing the npRmpi package). 

Note that in the following examples a) there is timing information used for comparison purposes, and b) these are meant to tax a serial (single core) machine thereby demonstrating the benefits from running in parallel, so expect lengthy run-times with the serial version (i.e. up to a few minutes depending on the speed of your machine).

  1. Least-squares cross-validated conditional density estimation (npcdensls_serial.Rnpcdensls_npRmpi.R)

  2. Consistent parametric model specification testing (npcmstest_serial.Rnpcmstest_npRmpi.R)

  3. Conditional mode estimation (npconmode_serial.R, npconmode_npRmpi.R)

  4. Density equality test (npdeneqtest_serial.Rnpdeneqtest_npRmpi.R)

  5. Semiparametric single index model estimation (npindexich_serial.Rnpindexich_npRmpi.R)

  6. Semiparametric partially linear regression (npplreg_serial.Rnpplreg_npRmpi.R)

  7. Local linear regression with AIC bandwidth selection (npregllaic_serial.Rnpregllaic_npRmpi.R)

  8. Test for nonlinear serial dependence (npsdeptest_serial.Rnpsdeptest_npRmpi.R)

  9. Nonparametric significance test (npsigtest_serial.Rnpsigtest_npRmpi.R)

  10. Unconditional density estimation via likelihood cross-validation (npudensml_serial.Rnpudensml_npRmpi.R)

  11. Constrained local polynomial estimation (lp_k1_prodfunc.Rlp_k1.Rlp_radial_mean.Rlp_radial_deriv.R)

Here is a link to the vignette for the np package (np vignette), and here are some references that you may find useful:

  1. Hayfield, T. and J.S. Racine (2008), “Nonparametric Econometrics: The np Package, Journal of Statistical Software, Volume 27, Number 5, 1-32.

  2. Harrison, T.D (2008), “Review of np Software for R,” Journal of Applied Econometrics, Volume 23, 861-865.

  3. Ho, A.T. and K.P. Huynh and D.T. Jacho-Chavez (2011), “npRmpi: A Package for Parallel Distributed Kernel Estimation in R,” Journal of Applied Econometrics, Volume 26, 344-349.