bpwpm2_gibbs: Bayesian Piece-Wise Polynomial Model 2 Algorithm

Description Usage Arguments Value Examples

Description

Second take at the bpwpm model, based solely on the Albert + Chibb Paper

Usage

1
2
3
4
bpwpm2_gibbs(Y, X, M, J, K, draws = 10^3, tau = NULL,
  beta_init = NULL, mu_beta_0 = NULL, sigma_beta_0_inv = NULL,
  precision_beta = 1, eps = 1e-15, verb = FALSE,
  debug_verb = FALSE)

Arguments

Y

Response vector of n binary observatios (integers 0,1 - vector of size n) Can be encoded as a factor a numeric vector.

X

Design matrix of n observations and d covariables (numeric - n*d)

M

M minus 1 is the degree of the polinomial (integer - M > 0)

J

Number of intervals in each dimention (integer - J > 1)

K

Order of continuity in the derivatives (integrer - 0 < K < M)

draws

Númber of samples to draw from the Gibbs Sampler (integer - draw > 0)

tau

the initial position of nodes selected by the user. although· arbitraty they need to match the dimentions. (numeric - (J-1)*d)

beta_init

Inital value for the Gibbs Sampler Chain (numeric - vector of size 1*(1 + Nd))

mu_beta_0

Prior Mean of Beta (numeric - matrix of size N*d)

sigma_beta_0_inv

sigma_w_0_inv:= Prior Inverse if the Variance-Covariance Matrices of w (list - d elements, each element is a numeric matrix of size N*N)

eps

Numerical threshold

verb

short for verbose, if TRUE, prints aditional information (logical)

debug_verb

If TRUE, print even more info to help with debug_verbging (logical)

precision_w

If using the default sigmas for w, a diagonal matrix will be used. Precision controls its magnitude (numeric - precision > 0)

Value

An object of the class "bpwpm" containing at the following components:

beta:

A data frame containing the Gibbs sampler simulation for beta

Psi:

The PWP Expansion for input matrix X and nodes selected on percentiles

tau:

Nodes used for training

M:

Initial parameters

J:

Initial parameters

K:

Initial parameters

d:

Number of dimentions

indep_terms:

Logical. If independent terms are keept

info

A string that prints the basic information of the mode. Used for the summary function.

Examples

1
2
See the main document of thesis for a couple of full examples
with its corresponding analysis.

PaoloLuciano/bpwpm2 documentation built on June 6, 2019, 5:47 p.m.