vectorize a function

Hello,

Can someone explain me how to vectorize? I try to estimate parameters or do loop using function from others and i get trouble with vectorize. I saw that we create within a function a function to vectorize like Vectorize (.) but when i do a loop for i from 1 to 10, i get error messages.

Thanks a lot

Can you show us a small sample problem.

Thank you for reply. Please let me think about a concrete example. It happens when i want to use a function for computing a price of a product, when it is only one product it works, but when i do a loop from i=1 to N, i have error messages like "object of type closure is not subsettable" or "evaluation of function gave a result of wrong length".

It would help if you could post a simple and short example of the code that you are using.

Sure you are right. I had a large code with several issues so please let me see how to simplify the code to focus only on the core function to vectorize. Many thanks. In the meantime i posted a question indirectly but got in addition to the vectorize problem a problem of integration , this is why i seperate the points. If you want you can have a look here (*) at the three last threads. Many thanks.