R: Fit a tilted Gaussian density via a Poisson GAM
GPois
R Documentation
Fit a tilted Gaussian density via a Poisson GAM
Description
This is a contrast method for ProDenICA. It fits a tilted
Gaussian density estimate by multiplying the Gaussian density by an
exponential tilt function using a cubic smoothing spline
Usage
GPois(x, df = 6, B = 500, order = 1, widen = 1.2, density.return = FALSE, ...)
Arguments
x
vector of real values
df
degrees of freedom for the smoothing-spline fit; default is 6
B
number of grid points for density estimate; default is 500
order
A robustness parameter to avoid responding to outliers in
x. The range of x is estimated by the orderth
and n-order+1th order statistics. Default is order=1
widen
an expansion factor to widen the range of x;
default is widen=1.2
density.return
logical variable, with default FALSE. If
density.return=TRUE, the estimated density is returned
...
additional arguments to GAM; typically not used
Details
See Section 14.7.4
of 'Elements of Statistical Learning (Hastie, Tibshirani and Friedman,
2009, 2nd Edition)' for details
Value
a list with components
Gs
estimated contrast function, which is the log of the tilting
function, evaluated at the original values of x. mean(Gs)
is measure of negentropy
gs
estimated first derivative of Gs at x
gps
estimated second derivative of Gs at x
density
if density.return=TRUE, a list with components
$x the grid of B values of x, and $y the estimated
density.
Author(s)
Trevor Hastie and Rob Tibshirani
References
Hastie, T. and Tibshirani, R. (2003) Independent Component Analysis
through Product Density Estimation in Advances in Neural Information
Processing Systems 15 (Becker, S. and Obermayer, K., eds), MIT Press,
Cambridge, MA. pp 649-656
Hastie, T., Tibshirani, R. and Friedman, J. (2009) Elements of
Statistical Learning (2nd edition), Springer. http://www-stat.stanford.edu/~hastie/Papers/ESLII.pdf
See Also
ProDenICA, G1 and G0
Examples
p=2
### Can use letters a-r below for dist
dist="n"
N=1024
A0<-mixmat(p)
s<-scale(cbind(rjordan(dist,N),rjordan(dist,N)))
x <- s %*% A0
fit=ProDenICA(x,Gfunc=GPois, whiten=TRUE, density=TRUE)
par(mfrow=c(2,1))
plot(fit)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(ProDenICA)
Loading required package: gam
Loading required package: splines
Loading required package: foreach
Loaded gam 1.12
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ProDenICA/GPois.Rd_%03d_medium.png", width=480, height=480)
> ### Name: GPois
> ### Title: Fit a tilted Gaussian density via a Poisson GAM
> ### Aliases: GPois
> ### Keywords: smooth distribution
>
> ### ** Examples
>
> p=2
> ### Can use letters a-r below for dist
> dist="n"
> N=1024
> A0<-mixmat(p)
> s<-scale(cbind(rjordan(dist,N),rjordan(dist,N)))
> x <- s %*% A0
> fit=ProDenICA(x,Gfunc=GPois, whiten=TRUE, density=TRUE)
> par(mfrow=c(2,1))
> plot(fit)
>
>
>
>
>
> dev.off()
null device
1
>