barrier-eval: Barrier Term in the Likelihood Function

Description Usage Arguments Details Value References See Also Examples

Description

This function evaluates a barrier term to be added to the log-likelihood function in order to penalize for parameter values close to the boundaries.

Usage

1
2
barrier.eval(model, type = c("1", "2"), mu = 0.01, 
  gradient = FALSE, hessian = FALSE)

Arguments

model

object of class stsm.

type

a character indicating the type of barrier term.

mu

the barrier multiplier. A positive value.

gradient

logical. If TRUE, the first order derivatives of the barrier term with respect to the parameters of the model are evaluated.

hessian

logical. If TRUE, the second order derivatives of the barrier term with respect to the parameters of the model are evaluated.

Details

A barrier term can be defined in order to penalize against parameter values close to the boundaries defined in model@lower and model@upper. The barrier term is added to the negative of the log-likelihood function, which is then given by:

-logLik + μ ∑_i q_i(x).

μ is a positive barrier multiplier, the larger it is the stronger the barrier is and, hence, the search is done farther from the boundaries (Rardin, 1998 Fig. 14.8); q_i(x) are the barrier functions that are defined in such a way that the barrier term grows to infinity as the parameters of the model approach to the boundaries. Two types of barrier functions are considered:

type = "1":

-log(par[i] - bound[i]), for lower bound constraints.

type = "1":

-log(bound[i] - par[i]), for upper bound constraints.

type = "2":

1/(par[i] - bound[i]), for lower bound constraints.

type = "2":

1/(bound[i] - par[i]), for upper bound constraints.

Value

A list containing the barrier term evaluated for the lower and upper bound constraints, bl and bu, respectively, and the first and second order derivatives of the barrier term, dl1, du1, dl2, du2.

References

Rardin, R.L. (1998). Section 14.5. Optimization in Operations Research. Prentice Hall.

See Also

mloglik.fd, mloglik.td.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# define local level plus seasonal model for a simulated time series
# and evaluate the barrier term for some parameter values
# the barrier term in the second model is higher since the variances 
# are closer to the lower bounds (zero)
data("llmseas")
pars <- c("var1" = 30, "var2" = 1, "var3" = 10)
m1 <- stsm.model(model = "llm+seas", y = llmseas, pars = pars)
bar1 <- barrier.eval(m1, type = "2", mu = 3)
bar1$barrier

pars <- c("var1" = 0.3, "var2" = 0.01, "var3" = 0.1)
m2 <- stsm.model(model = "llm+seas", y = llmseas, pars = pars)
bar2 <- barrier.eval(m2, type = "2", mu = 3)
bar2$barrier

# the barrier term is added to the negative of the likelihood function
# that will be the objective function to be minimized,
# value of minus log-likelihood without barrier
mloglik.fd(model = m2)
# adding a barrier term
mloglik.fd(model = m2) + bar2$barrier
mloglik.fd(model = m2, barrier = list(type = "2", mu = 3))

stsm documentation built on May 2, 2019, 7:39 a.m.