Description Usage Arguments Value Examples
Solves a system of non-linear equations using a modified Newton Method
1 2 3 4 5 6 7 8 9 10 |
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 |
MNR_Global |
wheather using line search, with fault value is FALSE. |
... |
any additional arguments passed to |
a list including x1 and crit. x1 is k times 1 vector, the approximate solution to F(x1)=0.
crit
is 1 vector, where
crit[1]=0
: normal termination
=1 : function evaluation failed,
=2 : no further decrease in function value possible,
=3 : maximum number of iterations exceedes
crit[2]
: termination criterion: max(abs(f(x)))
crit[3]
: the maximum relative change of x between the last two iterations
crit[4]
: f(x)'f(x)/2
crit[5]
: number of iterations
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.