1

I have a simple SAS (version 9.2) program as follows,

proc model;
cdf('normal',log(V/100)+1)=0.5;
bounds V>0;
solve V/solveprint;
run;

It throws exception that says jacobian matrix to be singular,

The Newton method Jacobian matrix of partial derivatives of the
equations with respect to the variables to be solved is singular.

What is the possible cause of this error?

Update: I have simplified the problem a bit. When modified to "cdf('normal', X)=0.5", it works without exception.

Update2: bounds is updated to V>0; but exception still there

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
Richard
  • 14,642
  • 18
  • 56
  • 77
  • Its not an error. It is saying that your matrix is singular, i.e. not invertible. If you are trying to solve a system of equations, your matrix must be invertible. – NickLH Nov 05 '11 at 19:56
  • does the part `cdf('normal',(log(V/90.986)+(0.0477+0.2*0.2*0.5))/0.2)` formulated correctly? since you are not specifying mean/stdev, they default to 1 and 0, so the value of the cdf() is vituruall 1. But SAS maybe having hard time because it still has tiny sensitivity to V, and wants to decrease V but you bounded it to be >1000. bound is adding extra condition to satisfy, causing problem to be unsolvable, i'd guess – yosukesabai Nov 05 '11 at 19:58
  • @NickLH I am aware that the matrix is quite sensitive to data, but how to make the matrix invertible? – Richard Nov 05 '11 at 20:16
  • @yosukesabai, when without bounds like V>1000, the exception persists. And I think the default mean should be 0 and stdev be 1... correct if I am wrong – Richard Nov 05 '11 at 20:22
  • 1
    If your matrix is not invertible then there's not much you can do about it. Singular Jacobian is the matrix equivalent of divide by zero. – David Heffernan Nov 05 '11 at 20:56
  • hmmm sorry, i lost sas account so i even cannot test it. maybe i am missing somthing. – yosukesabai Nov 05 '11 at 21:40

2 Answers2

3

What input data set are you passing to proc model? For example, this code works consistently:

data a;
 v=100;
run;

proc model data=a;
  cdf('normal',log(V/100)+1) = 0.5;
  bounds V>0;
  solve V / solveprint;
run;
quit;

And gives a solution of V=36.78794

But changing the input data somewhat (see below) will consistently give a singular Jacobian matrix error.

data a;
 v=0.00001;
run;

proc model data=a;
  cdf('normal',log(V/100)+1) = 0.5;
  bounds V>0;
  solve V / solveprint;
run;
quit;
cmjohns
  • 4,465
  • 17
  • 21
  • @Richard - Sorry about that, it was a copy/paste error - fixed it now. Just needed to change the V= statement in the first data step. – cmjohns Nov 08 '11 at 03:12
  • @cmjohns - Interesting. Do you know why this happens? I'm not too familiar with `proc model`. – itzy Nov 09 '11 at 15:18
1

You are asking SAS to solve a function that has no solution. You are asking for the value of V>1000 that makes this equation true. But there are no such values because log(1000/100+1) is about 3.3, and the CDF of a Normal random variable with mean 0 and standard deviation 1 evaluated at 3.3 is 0.9995. Any larger value of V will just move the function closer to 1, not toward 0.5, so there is no answer to your question.

By telling you that the matrix of partial derivatives is singular, SAS is just using fancy math speak for "your function doesn't have a solution". (Really what it's saying is, "I've turned your question into an equivalent maximization problem, and that problem doesn't have a maximum, so I can't help you.")

itzy
  • 11,275
  • 15
  • 63
  • 96
  • By the way, you can try solving `CDF('Normal',log(V/100+1)=0.9999` or something really close to 1 and that should give you a solution. – itzy Nov 05 '11 at 20:39
  • By changing constraints to V>0, there is still exception. – Richard Nov 05 '11 at 20:51
  • Hm, okay, that's not what I'd expect. I don't have access to SAS right now, so I can't test it. What happens if you take away the bound? – itzy Nov 05 '11 at 23:48
  • If take the bound away, it's the same thing; still the same exception. – Richard Nov 06 '11 at 01:45