Learn R Programming

BayesBridge (version 0.6)

trace.beta: Trace Plot

Description

Trace plot using expectation maximization.

Usage

trace.beta(y, X, alpha=0.5, ratio.grid=exp(seq(-20,20,0.1)), tol=1e-9, max.iter=30, use.cg=FALSE, plot.it=FALSE)

Arguments

y
An N dimensional vector of data.
X
An N x P dimensional design matrix.
alpha
A parameter.
ratio.grid
A grid of ratio=tau/sigma.
tol
The threshold at which the algorithm terminates.
max.iter
The maximum number of iterations to use.
use.cg
Use the conjugate gradient method.
plot.it
Plot it.

References

Nicolas G. Poslon, James G. Scott, and Jesse Windle. The Bayesian Bridge. http://arxiv.org/abs/1109.2279.

See Also

bridge.reg, bridge.EM.

Examples

Run this code
# Load the diabetes data...
data(diabetes, package="BayesBridge");
cov.name = colnames(diabetes$x);
y = diabetes$y;
X = diabetes$x;

# Center the data.
y = y - mean(y);
mX = colMeans(X);
for(i in 1:442){
    X[i,] = X[i,] - mX;
}

# Expectation maximization.
out = trace.beta(y, X);

Run the code above in your browser using DataLab