Re: [R] Dealing with a lot of parameters in a function

2010-08-02 Thread Wu Gong
Hi, Putting all parameters into a data frame would help. Code like: parameters <- data.frame(mu=1:24,b=(1:24)*2,tau=(1:24)/2,sigma=(1:24)^2,ro=sqrt(1:24)) ll<- function(parameters){ results <- numeric(24) for (i in 1:24){ mu <- parameters$mu[i] b <- parameters$b

Re: [R] Dealing with a lot of parameters in a function

2010-08-02 Thread nikhil kaza
use 24 length vectors as parameters instead of numbers e.g. mu=rep(0.5,24) On Mon, Aug 2, 2010 at 11:00 AM, Shentu, Yue wrote: > Hi all, > I'm trying to define and log-likelihood function to work with MLE. > There will be parameters like mu_i, sigma_i, tau_i, ro_i, for i between > 1 to 24. I