maximize_log_likelihood: Maximize the log-likelihood.

maximize_log_likelihoodR Documentation

Maximize the log-likelihood.

Description

Maximizes the log-likelihood using the GSL implementation of the BFGS algorithm. This function is primarily intended for advanced usage. The estimate functionality is a fast, analysis-oriented alternative. If the GSL is not available, the function returns a trivial result list with status set equal to -1. If the C++17 execution policies are available, the implementation of the optimization is parallelized.

Usage

maximize_log_likelihood(
  object,
  start,
  step,
  objective_tolerance,
  gradient_tolerance,
  max_it
)

## S4 method for signature 'equilibrium_model'
maximize_log_likelihood(
  object,
  start,
  step,
  objective_tolerance,
  gradient_tolerance,
  max_it
)

Arguments

object

A model object.

start

Initializing vector.

step

Optimization step.

objective_tolerance

Objective optimization tolerance.

gradient_tolerance

Gradient optimization tolerance.

max_it

Maximum allowed number of iterations.

Value

A list with the optimization output.

See Also

estimate

Examples


model <- simulate_model(
  "equilibrium_model", list(
    # observed entities, observed time points
    nobs = 500, tobs = 3,
    # demand coefficients
    alpha_d = -0.9, beta_d0 = 14.9, beta_d = c(0.3, -0.2), eta_d = c(-0.03, -0.01),
    # supply coefficients
    alpha_s = 0.9, beta_s0 = 3.2, beta_s = c(0.03), eta_s = c(0.05, 0.02)
  ),
  seed = 99
)

# maximize the model's log-likelihood
mll <- maximize_log_likelihood(
  model,
  start = NULL, step = 1e-5,
  objective_tolerance = 1e-4, gradient_tolerance = 1e-3, max_it = 1e+3
)
mll


diseq documentation built on June 2, 2022, 1:10 a.m.