KDKW.FD: Approximate maximum likelihood algorithm based on...

Description Usage Arguments Functions Gain sequences Author(s) References Examples

View source: R/KDKW.FD.R

Description

This function approximates the maximum likelihood estimate of the multivariate parameter theta. It requires a function to simulate data and compute summary statistics at each position of the parameter space. These simulations are used to obtain estimates the likelihood in a stochastic approximation algorithm based on finite differences approximation of the gradient (Kiefer-Wolfowitz algorithm).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
KDKW.FD(s.obs, theta.0, simfun, rest = matrix(c(-Inf, Inf), ncol = 2,
  nrow = length(theta.0), byrow = T), ce, gamma = 1/6, C = 0, a,
  alpha = 1, A = 0, K, nk, Hfun = bw.nrd0.mult, Hnum, kernel,
  lg = T, ...)

KDKW.FD.theta.0(theta.0, s.obs, simfun, rest = matrix(c(-Inf, Inf), ncol
  = 2, nrow = length(theta.0), byrow = T), ce, gamma = 1/6, C = 0, a,
  alpha = 1, A = 0, K, nk, Hfun = bw.nrd0.mult, Hnum, kernel,
  lg = T, ...)

KDKW.FD.s.obs(s.obs, theta.0, simfun, rest = matrix(c(-Inf, Inf), ncol =
  2, nrow = length(theta.0), byrow = T), ce, gamma = 1/6, C = 0, a,
  alpha = 1, A = 0, K, nk, Hfun = bw.nrd0.mult, Hnum, kernel,
  lg = T, ...)

Arguments

s.obs

Vector of observed summary statistics

theta.0

Vector of starting point

simfun

name of the function which is used to simulate data (further arguments to simfun are given with ...)

rest

Matrix with restrictions on the parameterspace (matrix with 2 columns that contain the lower and upper bounds for the elements of theta). Use -Inf and Inf for unrestricted parameters. The default value is an unrestricted parameter space.

ce

numeric

gamma

numeric

C

integer

a

numeric

alpha

numeric

A

integer

K

number of steps

nk

number of simulations per step

Hfun

function which computes the bandwidth matrix. Can be one of the functions in bw.r

Hnum

how often shall the bandwidth matrix be computed? Possible values: "once" or an integer indicating after how many iterations the bandwidth selection is to be renewed (e. g. 1 => bandwidth selection in each step)

kernel

kernel function

lg

logical. Use the log-likelihood instead of the likelihood?

...

further arguments which are passed on to simulate the data with simfun

Functions

Gain sequences

The gain sequences are defined following Spall (2013):

a_k = a/(k + A)^alpha and c_k = c/(k + C)^gamma.

Usually, C>0 is only used if the algorithm is resumed. The default values alpha=1 and gamma=1/6 are given in Spall (2013).

Author(s)

Johanna Bertl

References

Examples

1
2
3
# bivariate normal distribution with sumstats x1+x2 and x1-x2:

test1 = KDKW.FD(s.obs=c(2,0), theta.0=c(50,50), simfun=SIMnormal.mult2a, rest=matrix(c(-100, 100), ncol=2, nrow=2, byrow=T), ce=1, gamma = 1/6, C=0, a = 10, alpha = 1, A=0, K=200, nk=20, Hfun = bw.nrd0.flex, Hnum="once", kernel=robust.unscaled.diagonal, lg = T, n=1)

johannabertl/ApproxML documentation built on May 22, 2019, 2:19 p.m.