PAC-Bayesian Estimation and Prediction in Sparse Additive Models

Share:

Description

This package is intended to perform estimation and prediction in high-dimensional additive models, using a PAC-Bayesian point of view and a MCMC algorithm.

Details

Package: pacbpred
Type: Package
Version: 0.92.2
Date: 2013-02-05
License: GPL (>= 2)

Author(s)

Benjamin Guedj

Maintainer: Benjamin Guedj <benjamin.guedj@upmc.fr>

References

http://www.lsta.upmc.fr/doct/guedj/index.html

Guedj and Alquier (2013), 'PAC-Bayesian Estimation and Prediction in Sparse Additive Models'. Electronic Journal of Statistics, 7, 264–291. DOI:10.1214/13-EJS771. Available on http://projecteuclid.org/DPubS?service=UI&version=1.0&verb=Display&handle=euclid.ejs/1359041592.

See Also

pacbpred

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ndata <- 100
ntrain <- 80
ntest <- ndata - ntrain
p <- 10
Y <- numeric(ndata)
X <- matrix(nr = ndata, nc = p, data = 2*runif(n = ndata*p) - 1)
for(i in 1:ndata)
  {
    Y[i] <- X[i,1]^3+sin(pi*X[i,2])
  }

Xtrain <- X[1:ntrain,]
Xtest <- X[(ntrain+1):ndata,]
Ytrain <- Y[1:ntrain]
Ytest <- Y[(ntrain+1):ndata]

niter <- 100
cst <- Inf
alpha <- .1
sigma2 <- .1
delta <- ntrain/2

res <- pacbpred(niter = niter, Xtrain = Xtrain, Xtest = Xtest, Y =
Ytrain, cst = cst,
sigma2 = sigma2, delta = delta, alpha = alpha)

print(cbind(res$predict,Ytest))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.