# Example 1
# Two cross-sectional series (i = 2,3),
# with each series required to be between 0 and 1.
n <- c(2, 3)
lb <- c(0, 0)
ub <- c(1,1)
bounds_mat <- set_bounds(n = c(2, 3),
lb = rep(0, 2), # or lb = 0
ub = rep(1, 2)) # or ub = 1
# Example 2
# All the monthly values are between 0 and 1.
bounds_mat <- set_bounds(k = rep(1, 12), # or k = 1
h = 1:12,
lb = rep(0, 12), # or lb = 0
ub = rep(1, 12)) # or ub = 1
# Example 3
# For two cross-sectional series (i = 2,3),
# all the monthly values are between 0 and 1.
bounds_mat <- set_bounds(n = rep(c(2, 3), each = 12),
k = 1,
h = rep(1:12, 2),
lb = 0, # or lb = 0
ub = 1) # or ub = 1
Run the code above in your browser using DataLab