Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Interface between kdb+ and rmathlib
C C++ Shell
Branch: master

Update sde.q

Add dW(t) for CIR and GBM processes
latest commit e148a5f504
@rwinston authored
Failed to load latest commit information.
Makefile makefile tweaks readme updates Add files
rmath.c Update some prob functions
rmath.h Update some prob functions
rmath_aux.q Update some prob functions
sde.q Update sde.q

Q/RMathLib interface

This is a simple interface between the standalone R mathlib and kdb+/q.

The source contains the following:

  • rmath.h/rmath.c - source files (rmath.h contains exported function definitions)
  • rmath_aux.q - extra Q definitions and helpers
  • - generates Q import lib scripts
  • Makefіle - simple makefile


In a q session:

 q) \l rmath.q
 q) x:rnorm 1000     / create 1000 normal variates
 q) summary x        / simple statistical summary of x
 q) hist[x;10]       / show histogram (bin count) with 10 bins
 q) y:scale x        / x = (x - mean(x))/sd(x)
 q) quantile[x;.5]   / calculate the 50% quantile
 q) pnorm[0;1.5;1.5] / cdf value for 0 for a N(1.5,1.5) distribution
 q) dnorm[0;1.5;1.5] / normal density at 0 for N(1.5;1.5) distribution


for more details

Something went wrong with that request. Please try again.