Description Usage Arguments Details Value Examples
Design matrix for pms parametrization given the max degree of the Hurdle polynomial.
1 | full_design1(Vo, Yo, right, V_degree = 1, Y_degree = 1, Y_V_degree = 1)
|
Vo |
A numerical matrix of the same dimension as |
Yo |
A numerical matrix, the sample matrix for the parent nodes (regressors). |
right |
A string vector of length equal to |
V_degree |
A non-negative integer, the degree for the |
Y_degree |
A non-negative integer, the degree for the |
Y_V_degree |
A non-negative integer, the degree for interaction between |
A Hurdle polynomial in parents Yo is a polynomial in Yo and their 0/1 indicators Vo.
The V_degree of a term that is a product of some columns of Vo only is the number of parents that appears in it. For example, V1 * V2 * V3 has V_degree equal to 3. Note that V1^p is equal to V1 for any p >= 1 so it does not make sense to include a power.
The Y_degree of a term that is a product of powers of some columns of Yo only is the degree of a polynomial in its usual sense. For example, Y1^2 * Y2 * Y3^3 has Y_degree equal to 2+1+3=6.
The Y_V_degree of a term that involves both some columns of Vo and some of Yo is the sum of the V_degree of the V part and the Y_degree of the Y part. For example, Y1^2 * V2 * Y3^3 * V4 * V5 has Y_V_degree equal to 2+1+3+1+1=8.
The function returns a Hurdle polynomial including all possible terms with V_degree, Y_degree, Y_V_degree less than or equal to those specified.
For example, if Vo and Yo has two columns and V_degree == 2, Y_degree == 2, Y_V_degree == 2, the function returns a matrix with columns V1, V2, V1*V2, Y1, Y2, Y1*Y2, Y1^2, Y2^2, Y1*V2, Y2*V1.
Note that terms like V1*Y1 are not included as it is equivalent to Y1.
Intercepts (a column with all 1s) are also not included.
The design matrix with number of rows equal to nrow(Vo).
1 2 3 | Yo <- matrix(rnorm(100) * rbinom(100, 1, 0.7), ncol=2)
full_design1(Yo != 0, Yo, c("1", "2"), V_degree=2, Y_degree=2, Y_V_degree=2)
full_design1(Yo != 0, Yo, c("1", "2"), V_degree=0, Y_degree=0, Y_V_degree=0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.