Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: mm_root arguments limitation issue

From   "Tharyan, Rajesh" <>
To   "" <>
Subject   st: mm_root arguments limitation issue
Date   Sat, 30 Jul 2011 10:26:03 +0100

Hi all

I am trying to run a program  like below,  using Ben Jann's  mm_root function within the moremata program.

ssc install moremata
clear all
sysuse auto,clear
gen y=price/24
gen z= mpg/12
g x =.
st_view(v,.,"x  price mpg rep78 trunk weight length turn displacement y z headroom") function y(x,a,b,c,d,e,f,g,h,i,j,k) { return ((-1*(a-b)*(1+x)^5) + ((c-(b*x))*(1+x)^4) + ((d-(e*x))*(1+x)^3) + ((f-(g*x))*(1+x)^2) + ((h-(i*x))*(1+x)) + ((j-(k*x))) + ((j-(k*x))/x)) } for (i=1;i<=rows(v);i++) { r=mm_root(x=.,&y(),0,1,0,1000,v[i,2],
l in 1/10, noo

I get the following error
               mm_root():  3001  expected 4 to 16 arguments but received 17
                 <istmt>:     -  function returned error r(3001);

a look at the help file  seems to suggest that  the number of  additional arguments to pass on to function f is  limited to 10. 

Q1. Could  there any particular reason why it is limited to 10? 
Q2. Is there a way to increase the number of options?
Q3. Setting the
           lo:  real scalar containing lower endpoint of the search interval
           up:  real scalar containing upper endpoint of the search interval to 0 and 1 leads to a large number of zeros and 1. cross checking with Excel solver  shows that in such cases the  answer is actually different. Is there a best way to set lo and up values? 

Thanks very much for your time


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index