Re: [R] Running the optimization on the subset of parameters

From: Roger D. Peng <rpeng_at_jhsph.edu>
Date: Sun 18 Jul 2004 - 03:59:30 EST

If you use the mle() function in the `stats4' package, you don't have to do anything special. For example,

 > negloglik <- function(a, b) { a^2 + b^2 }  > mle(negloglik, start = list(a = 2), fixed = list(b = 4))

Call:
mle(minuslogl = negloglik, start = list(a = 2), fixed = list(b = 4))

Coefficients:

            a b
2.202682e-13 4.000000e+00
 > mle(negloglik, start = list(b = 2), fixed = list(a = 4))

Call:
mle(minuslogl = negloglik, start = list(b = 2), fixed = list(a = 4))

Coefficients:

            a b
4.000000e+00 2.202682e-13
 >

-roger

Victoria Landsman wrote:

> Dear all, I'd like to find a minimum of (-loglik) function
> which is a function of k parameters. I'd like to run the
> minimization algorithm for the different subsets of the
> parameters and assign the fixed values to the complementary
> subset. How should I define my (-loglik) function such that it
> can be passed to the optim or other optimization function?
>
> Much thanks for any suggestions. Vicky Landsman. [[alternative
> HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE
> do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jul 18 04:09:35 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:03 EST