modelspec {cvmaPLFAM} | R Documentation |
Generate candidate models
Description
Specify non-nested or nested candidate models, according to the prescribed number of scalar predictors and the number of functional principal components (FPCs). Each candidate model comprises at least one scalar predictor and one FPC.
Usage
modelspec(nump, numq, method = NULL)
Arguments
nump |
The number of scalar predictors used in candidate models. |
numq |
The number of functional principal components (FPCs) used in candidate models. |
method |
A character string or NULL.
If |
Value
A list
of
a1 |
The number of scalar predictors in each candidate model. |
a2 |
The number of FPCs in each candidate model. |
a3 |
The index for each component in each candidate model. |
Examples
# Example 1: non-nested models
# Given nump = 2 and numq = 2, resulting in 9 candidate models
modelspec(2, 2)
#$a1
#[1] 2 2 2 1 1 1 1 1 1
#$a2
#[1] 2 1 1 2 1 1 2 1 1
#$a3
# [,1] [,2] [,3] [,4]
# [1,] 1 2 3 4
# [2,] 1 2 3 0
# [3,] 1 2 0 4
# [4,] 1 0 3 4
# [5,] 1 0 3 0
# [6,] 1 0 0 4
# [7,] 0 2 3 4
# [8,] 0 2 3 0
# [9,] 0 2 0 4
# Example 2: nested models
# Given nump = 2 and numq = 3, resulting in 6 candidate models
modelspec(2, 3, method = "nested")
#$a1
# [1] 2 2 2 1 1 1
#$a2
# [1] 3 2 1 3 2 1
#$a3
# [,1] [,2] [,3] [,4] [,5]
# [1,] 1 2 3 4 5
# [2,] 1 2 3 4 0
# [3,] 1 2 3 0 0
# [4,] 1 0 3 4 5
# [5,] 1 0 3 4 0
# [6,] 1 0 3 0 0
[Package cvmaPLFAM version 0.1.1 Index]