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

2010-08-02 Thread Shentu, Yue
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. Instead of listing all the parameters, one by one in the function definition, is there a neat way to do it in R ? The example is as

[R] Error msg in optim : (list) object cannot be coerced to type 'double'

2010-08-02 Thread Shentu, Yue
Hi all, Thanks to the suggestion from Nikhil to use vector parameters, I have made some progress with my MLE code. I have however encountered another problem with the optimization step. The code is as follows: est.x-as.vector(tapply(Diff_A1c_6_0,factor(Study_Compound_ID),mean)) ll-