Re: [R] using optimize with two unknowns, e.g. to parameterize a distribution with given confidence interval

2010-10-19 Thread Ravi Varadhan
You cannot use `optimize' when there are two or more parameters to be optimized. I don’t know if other have suggested any solution to this, but here are 2 approaches: # Estimating LCL and UCL separately using `optimize'. prior.lcl - function(x, alpha, mean, var) { a - abs(plnorm(x, mean, var)

Re: [R] using optimize with two unknowns, e.g. to parameterize a distribution with given confidence interval

2010-10-16 Thread Ben Bolker
David LeBauer dlebauer at illinois.edu writes: Hi, I would like to write a function that finds parameters of a log-normal distribution with a 1-alpha CI of (x_lcl, x_ucl): However, I don't know how to optimize for the two unknown parameters. Try optim instead.

[R] using optimize with two unknowns, e.g. to parameterize a distribution with given confidence interval

2010-10-15 Thread David LeBauer
Hi, I would like to write a function that finds parameters of a log-normal distribution with a 1-alpha CI of (x_lcl, x_ucl): However, I don't know how to optimize for the two unknown parameters. Here is my unsuccessful attempt to find a lognormal distribution with a 90%CI of 1,20: prior -