bpwpm_gibbs: Bayesian Piecewise Polinomial Model

Description Usage Arguments Value Examples

View source: R/bpwpm_gibbs.R

Description

Gibbs Sampler for simulating draws of parameters for the Bayesian Piece Wise Polinomial model described on the thesis.

Usage

1
2
3
bpwpm_gibbs(Y, X, M, J, K, precision_w = 1, draws = 10^3, tau = NULL,
  w_init = NULL, mu_w_0 = NULL, sigma_w_0_inv = NULL,
  indep_terms = FALSE, verb = FALSE, debug = 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 - K < M)

precision_w

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

draws

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

tau

the initial position of nodes selected by the user. although<c2><b7> arbitraty they need to match the dimentions. (numeric - (J-1)*d) of size d) beta (numeric - matrix of size d*d)

w_init

Inital value for the Gibbs Sampler Chain (numeric - matrix of size N*d)

mu_w_0

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

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

indep_terms

Keeps the independent terms in the PWP expansion. Leaving those terms might lead to identificability errors. (logical)

verb

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

debug

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

Value

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

betas:

A data frame containing the Gibbs sampler simulation for beta

w:

A list of d elements. Each one is a data frame containign the simulation of the w_j parameters for each dimetnion j.

Phi:

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 the thesis for a couple of full examples
with its corresponding analysis.

PaoloLuciano/bpwpm documentation built on May 20, 2019, 4:25 p.m.