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. The method is fully described in Guedj and Alquier (2013), 'PAC-Bayesian Estimation and Prediction in Sparse Additive Models', see http://projecteuclid.org/DPubS?service=UI&version=1.0&verb=Display&handle=euclid.ejs/1359041592.

1 2 3 |

`niter` |
Mandatory. The number of MCMC iterations. |

`burnin` |
Optional. How many iterations should be discarded in the beginning of the chain? |

`Xtrain` |
Mandatory. The design matrix of the training sample. |

`Xtest` |
Optional. The design matrix of the test sample. |

`Y` |
Mandatory. The vector of responses corresponding to |

`K` |
Optional. The maximal order of the development on the trigonometric basis. |

`cst` |
Optional. A numerical constant bounding from above the sup norm of true regression function. |

`sigma2` |
Optional. The variance of the proposal density along the algorithm. |

`alpha` |
Optional. The penalization term over the complexity of a model. |

`delta` |
Optional. The inverse temperature parameter. |

See Guedj and Alquier (2013), 'PAC-Bayesian Estimation and Prediction in Sparse Additive Models' on http://projecteuclid.org/DPubS?service=UI&version=1.0&verb=Display&handle=euclid.ejs/1359041592.

A list composed of the following items.

`predict` |
If |

`estimates` |
The vector of estimates over the trigonometric basis. |

`ratio.mcmc` |
A vector of the MCMC ratio for each iteration. |

`accept` |
A logical vector whose length is the number of iterations. For each iteration, has the proposed move been accepted ? |

`models.mcmc` |
The current models all along the MCMC chain. |

This is still an early stage development. Use at your own risk !

Benjamin Guedj

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.

pacbpred-package

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))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.