icasamp | R Documentation |
Sample observations from the 18 source signal distributions used in Bach and Jordan (2002). Can also return density values and kurtosis for each distribution. Use icaplot
to plot distributions.
icasamp(dname, query = c("rnd","pdf","kur"), nsamp = NULL, data = NULL)
dname |
Distribution name: letter "a" through "r" (see Bach & Jordan, 2002). |
query |
What to return: |
nsamp |
Number of observations to sample. Only used if |
data |
Data values for density evaluation. Only used if |
Inspired by usr_distrib.m
from Bach's (2002) kernel-ica
MATLAB toolbox.
If query="rnd"
, returns random sample of size nsamp
.
If query="pdf"
, returns density for input data
.
If query="kur"
, returns kurtosis of distribution.
Nathaniel E. Helwig <helwig@umn.edu>
Bach, F.R. (2002). kernel-ica. MATLAB toolbox (ver 1.2) http://www.di.ens.fr/~fbach/kernel-ica/.
Bach, F.R. & Jordan, M.I. (2002). Kernel independent component analysis. Journal of Machine Learning Research, 3, 1-48.
########## EXAMPLE ########## # sample 1000 observations from distribution "f" set.seed(123) mysamp <- icasamp("f","rnd",nsamp=1000) xr <- range(mysamp) hist(mysamp,freq=FALSE,ylim=c(0,.8),breaks=sqrt(1000)) # evaluate density of distribution "f" xseq <- seq(-5,5,length.out=1000) mypdf <- icasamp("f","pdf",data=xseq) lines(xseq,mypdf) # evaluate kurtosis of distribution "f" icasamp("f","kur")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.