FixVMN2: FixvMN2

Description Usage Arguments Value Examples

View source: R/FixVMN2.R

Description

Solves a system of non-linear equations using a modified Newton Method

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
FixVMN2(
  x0,
  bounds,
  f,
  stopc = 1e-07,
  pTol = .Machine$double.eps^(2/3),
  MNR_CDJac = TRUE,
  MNR_Global = FALSE,
  ...
)

Arguments

x0

k times 1 vector of starting values

bounds

k timex 2 vector of upper and lower bounds on x

f

Pointer the vector valued function F(x), whose zero, F(x1)=0, is to be computed.

stopc

stopping criterium

pTol

parameter convergence criterium

MNR_CDJac

wheather using CDJac computing Jacobian matrix, with fault value is TRUE.

MNR_Global

wheather using line search, with fault value is FALSE.

...

any additional arguments passed to f.

Value

a list including x1 and crit. x1 is k times 1 vector, the approximate solution to F(x1)=0.

crit is 1 vector, where

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# para setting
library(matlab)
alpha <- 0.27
betax <- 0.994
tmax <- 60

x0 <- ones(tmax,1)
bounds <- data.frame(dw = ones(tmax,1)*0.01, up = ones(tmax,1)*30)
FixVMN2(x0 = x0,bounds = bounds, f = ramsey, k0 = 4.4, kT = 0, delta = 0.011)

# another function to solve it
rootSolve::multiroot(f = ramsey,start = x0,k0 = 4.4, kT = 0, delta = 0.011)

common2016/HM2009 documentation built on Dec. 19, 2021, 6 p.m.