broyden: Computes root of function via Broyden's Inverse Update Method

Description Usage Arguments Value Author(s) References Examples

View source: R/broyden.R

Description

Computes root of function via Broyden's Inverse Update Method

Usage

1
2
broyden(f, x, ..., opt = list(tol = sqrt(.Machine$double.eps), maxit = 100,
  maxsteps = 25, initb = NULL, initi = FALSE, showiters = FALSE))

Arguments

f

function, R^d –> R^d

x

d-array, initial guess for root

...

additional arguments to pass to f

opt

list, options to control rootfinding process

  • tol convergence tolerance

  • maxit maximum number of iterations

  • maxsteps maximum number of backsteps

  • initb an initial inverse Jacobian approximation matrix

  • initi if initb is empty, use the identity matrix to initialize ( if FALSE, a numerical Jacobian will be used)

  • showiters display results of each iteration if TRUE

Value

A list with fields

Author(s)

Randall Romero-Aguilar, based on Miranda & Fackler's CompEcon toolbox

References

Miranda, Fackler 2002 Applied Computational Economics and Finance

Examples

1
2
3
4
5
6
broyden(function(x) (x-2)^3, 4)
broyden(function(x) (x-2)^3, 3, opt = list(showiters=TRUE))

# Compute fixedpoint of f(x1,x2)= [x1^2 + x2^3;   x1*x2 - 0.5]
# Initial values [x1,x2] = [-1,-1].  True fixedpoint is x1 = -(1/8)^(1/5),  x2 = 1/(2*x1).
broyden(function(x) c(x[1]^2 + x[2]^3, x[1]*x[2] - 0.5), c(-1,-1))

randall-romero/CompEconR documentation built on May 26, 2019, 10:56 p.m.