# NOT RUN {
# Restrict equality of fractional parameters.
# }
# NOT RUN {
opt <- FCVARoptions()
opt$dbStep1D <- 0.2 # Coarser grid for plotting example.
opt$dbMin <- c(0.01, 0.01) # Set lower bound for d,b.
opt$dbMax <- c(2.00, 2.00) # Set upper bound for d,b.
opt$constrained <- 0 # impose restriction dbMax >= d >= b >= dbMin ? 1 <- yes, 0 <- no.
opt$restrictDB <- 1 # impose restriction d=b ? 1 <- yes, 0 <- no.
opt$progress <- 2 # Show progress report on each value of b.
x <- votingJNP2014[, c("lib", "ir_can", "un_can")]
likeGrid_params <- FCVARlikeGrid(x, k = 2, r = 1, opt)
plot(likeGrid_params)
# }
# NOT RUN {
# Linear restriction on fractional parameters.
# }
# NOT RUN {
opt <- FCVARoptions()
opt$dbStep1D <- 0.2 # Coarser grid for plotting example.
opt$dbMin <- c(0.01, 0.01) # Set lower bound for d,b.
opt$dbMax <- c(2.00, 2.00) # Set upper bound for d,b.
opt$constrained <- 0 # impose restriction dbMax >= d >= b >= dbMin ? 1 <- yes, 0 <- no.
opt$restrictDB <- 0 # impose restriction d=b ? 1 <- yes, 0 <- no.
# Impose linear restriction on d and b:
opt$R_psi <- matrix(c(2, -1), nrow = 1, ncol = 2)
opt$r_psi <- 0.5
opt$progress <- 2 # Show progress report on each value of b.
x <- votingJNP2014[, c("lib", "ir_can", "un_can")]
likeGrid_params <- FCVARlikeGrid(x, k = 2, r = 1, opt)
plot(likeGrid_params)
# }
# NOT RUN {
# Constrained 2-dimensional optimization.
# Impose restriction dbMax >= d >= b >= dbMin.
# }
# NOT RUN {
opt <- FCVARoptions()
opt$dbStep1D <- 0.2 # Coarser grid for plotting example.
opt$dbStep2D <- 0.2 # Coarser grid for plotting example.
opt$dbMin <- c(0.01, 0.01) # Set lower bound for d,b.
opt$dbMax <- c(2.00, 2.00) # Set upper bound for d,b.
opt$constrained <- 1 # impose restriction dbMax >= d >= b >= dbMin ? 1 <- yes, 0 <- no.
opt$restrictDB <- 0 # impose restriction d=b ? 1 <- yes, 0 <- no.
opt$progress <- 2 # Show progress report on each value of b.
x <- votingJNP2014[, c("lib", "ir_can", "un_can")]
likeGrid_params <- FCVARlikeGrid(x, k = 2, r = 1, opt)
# }
# NOT RUN {
# Unconstrained 2-dimensional optimization.
# }
# NOT RUN {
opt <- FCVARoptions()
opt$dbStep1D <- 0.1 # Coarser grid for plotting example.
opt$dbStep2D <- 0.2 # Coarser grid for plotting example.
opt$dbMin <- c(0.01, 0.01) # Set lower bound for d,b.
opt$dbMax <- c(2.00, 2.00) # Set upper bound for d,b.
opt$constrained <- 0 # impose restriction dbMax >= d >= b >= dbMin ? 1 <- yes, 0 <- no.
opt$restrictDB <- 0 # impose restriction d=b ? 1 <- yes, 0 <- no.
opt$progress <- 2 # Show progress report on each value of b.
x <- votingJNP2014[, c("lib", "ir_can", "un_can")]
likeGrid_params <- FCVARlikeGrid(x, k = 2, r = 1, opt)
# }
Run the code above in your browser using DataLab