-1

I am trying to fit a gamma distribution to a variable when i have two quantiles: 0.25 = 1508 0.75=2702 I have managed to use get.norm.par(p=c(0.25,0.75),q=c(1508,2702)) for the normal distribution - and have done the log-logisitc, log-normal etc...

But with the gamma distrubtion it displays this message: "The fitting procedure 'L-BFGS-B' has failed (convergence error occured or specified tolerance not achieved)!"

I have tried to increase the convergence:

get.gamma.par(p=c(0.25,0.75),q=c(1508,2702)), tol=0.1

but then i get an error message saying:

Error: unexpected ',' in get.gamma.par(p=c(0.25,0.75),q=c(1508,2702)),
WSBT
  • 33,033
  • 18
  • 128
  • 133
  • The reason you get `Error: unexpected ',' in get.gamma.par(p=c(0.25,0.75),q=c(1508,2702)),` is because you are placing the `tol = 0.1` out side the final bracket. Should be `get.gamma.par(p=c(0.25,0.75),q=c(1508,2702), tol=0.1)` – amwill04 Oct 15 '15 at 15:58

1 Answers1

0

You need to learn to read R error messages. That message told you that there was an unexpected comma after the call to get.gamma.par( ... ). And amwill04 told you to take out the extra paren. Notice that the error message did not appear to have anything to do with numeric values given to your function or limits exceeded, Whenever you get an error that begins with "Error: unexpected ...", it means the parser is having problems and it might be incorrect placement of parentheses as in this case or several other syntactic errors. There's a much more extensive listing of such errors on SO as well as advice on how to spot and avoid in the future.

I initially thought to vote to close as a simple typo but thought there was a more general lesson to be acquired that might be useful to other new useRs.

Community
  • 1
  • 1
IRTFM
  • 258,963
  • 21
  • 364
  • 487