BookmarkSubscribeRSS Feed
ayaafarag
Calcite | Level 5

this my code and after I run it I got this error message:

 

ERROR: Overflow error in NLPQN.

operation : NLPQN at line 5279 column 1

operands  : *LIT1222, k, optn, , , , , , *LIT1223

*LIT1222      1 row       1 col     (character, size 3)

fun

k      1 row       2 cols    (numeric)

         0         0

optn      1 row      11 cols    (numeric)

*LIT1223      1 row       1 col     (character, size 3)

con

statement : CALL at line 5279 column 1

*****************************************

 

where  l and g are vectors

 

the code is :

proc
iml;

start
fun(K) global

(l,e,g,p);

sumf=0;

do
i =
1to
p;

sumf
= sumf + (((e*l)+ ( k**
2

* g**
2 )) /(l+
k)**
2);

end;

return
(sumf);

finish    
fun;

start
con(k) global

(l,lg,e1,n,ny,p,g2,z,g);

c=j(5,1,0);

sumc1=0;

do
i =
1to
p;

sumc1
= sumc1 + (

(g2*l**
2)

/(l+k)**
2  );

end;

sumc3=0;

do
i =
1to
p;

sumc3
= sumc3 + (((e1*l)+ ( k**
2

* g**
2 )) /(l+
k)**
2);

end;

sumc41=0;

do
i =
1to
n;

sumc41
= sumc41 +(

(ny-((z[i,
1]*g[1]*l[1])/(la[1]+k[1]))-((z[i,2]*g[2]*l[2])/(l[2]+k[2]))

)**
2  );

end;

sumc42=0;

do
i=
1to
n;

sumc42=sumc42+(1-((z[i,1]**2)/(l[1]+k[1]))-((z[i,2]**2)/(l[2]+k[2]))

);

end;

sumc4=(n*sumc41)/(sumc42)**2;

c[1]=
lg-sumc1;

c[2]=k[1];

c[3]=k[2];

c[4]=3-sumc3;

c[5]=4-sumc4;

return
(c);

finish
con;

k=j(1,2,0);

optn=j(1,11,.);

optn[
11]=0;

optn[
10]=5;

call nlpqn (rc, kres, "fun", k, optn)
nlc=
"con";

1 REPLY 1
RobPratt
SAS Super FREQ

Looks like the code got mangled in the cut and paste.  I get other errors like this one:

     ERROR: DO expression not given value.

Can you please try attaching the code as a file instead?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 980 views
  • 0 likes
  • 2 in conversation