# 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
Run the code above in your browser using DataLab