Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: could not calculate numerical derivatives

From   vesile kutlu <>
Subject   st: could not calculate numerical derivatives
Date   Tue, 20 Nov 2012 14:57:51 +0100

Austin, thank you for your suggestion. I think mm_root  is for
finding one root (univariate) of a function. In my case, I need a
bivariate root finder because I have two arguments in my objective
 I tried something different with the “optimize” command.  I used the
d1 evaluator and entered the first order conditions manually. I do not
get the error “could not find numerical derivatives” anymore. However,
I have another problem. The solution is identical to the initial
values. If I enter (1,1) for initial values, the program returns (1,1)
as a solution. Is there anyone who knows why this is the case? Thank

: void mysolver(todo, p, v, g, H)
 v = (0.7-exp((p[1]/p[2])*(exp(p[2]*48)-exp(p[2]*75))))^2+(0.4-exp((p[1]/p[2])*(exp(p[2]*48)-exp(p[2]*80))))^2
 if (todo==1) {
 g[1] = -2*exp((p[1]/p[2])*(exp(p[2]*48)-exp(p[2]*75)))*(0.7-exp((p[1]/p[2])*(exp(p[2]*48)-exp(p[2]*75))))*((1/p[2])*(exp(p[2]*48)-exp(p[2]*7
 g[2] = -2*exp((p[1]/p[2])*(exp(p[2]*48)-exp(p[2]*75)))*(0.7-exp((p[1]/p[2])*(exp(p[2]*48)-exp(p[2]*75))))*((p[1]/(p[2]^2))*(-exp(p[2]*48)+ex
note: argument H unused
 S = optimize_init()
 optimize_init_evaluator(S, &mysolver())
 optimize_init_evaluatortype(S, "d1")
 optimize_init_params(S, (0.5,0.5))
 optimize_init_which(S, "min")
Iteration 0:   f(p) =        .65
Iteration 1:   f(p) =        .65
        1    2
  1 |  .5   .5  |

Phd Candidate, Utrecht University

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index