[R] questions about optim
Dean Lee
deanylee at hotmail.com
Sat May 15 22:13:54 CEST 2004
Hi,
I am trying to do parameter estimation with optim, but I can't get it to
work quite right-- I have an equation X = Y where X is a gaussian, Y is a
multinomial distribution, and I am trying to estimate the probabilities of
Y( the mean and sd of X are known ), Theta1, Theta2, Theta3, and Theta4; I
do not know how I can specify the constraint that Theta1 + Theta2 + Theta3 +
Theta4 = 1 in optim. Is there another method/package that I should use for
this?
Also, I wonder if there's a more elegant way to code this equation in R;
right now my function looks something like Y/rnorm( 10000, mean, sd), and I
try to maximize it to 1; is it possible to "plug" the entire gaussian(
instead of using rnorm ) into the equation? Thanks.
Regards,
-Dean
More information about the R-help
mailing list