And you should learn that rhelp is NOT on Nabble and that the list
rules say that you should be posting context for your
postings ...even when (or perhaps especially when) you are amending
earlier requests for help.
That certainly helps Petr. In terms of the overall question, perhaps it is better to show the code and reexplain what exactly I am trying to do:
1. I have logetf values in a [3300,9] matrix
2. I am trying to find the w value in the function: sum(abs(retT-w*prcomp(ret[(1+i):(252+i),]$rotation[,1])
3. retT are time T log etf value, prcomp(ret[(1+i):(252+i),]$rotation[,1] is the Principal component value for 252 days prior to time T.
4. I want to utilize the DEoptim() function in a loop from time T (the beginning T value is logetf value on the 253rd day) until the last day, which would correspond with nrow(ret) [or around 3300]. DEoptim will find the w value that minimizes that function.
If there is any more information I can provide to make it more clear, please let me know. My coding skills is really subpar for this project but I need to finish it asap. I REALLY appreciate anyone's help!