I am new to R. any help is welcome.
Let's say I have a function A in R that returns a matrix A(x).
How i can I compute ?
I am aware of the existence of integrate, but this function works only with scalar functions.
thank you in advance
Asked
Active
Viewed 857 times
0

maroxe
- 2,057
- 4
- 22
- 30
-
Can you give an example of the function? – jlhoward Apr 05 '14 at 18:58
1 Answers
1
I would just do a loop for it with rectangles or something.
res=0
for (i in seq(0,1,1/10000)[-10001])
res=res+A(i)
res=res/10000

Max Candocia
- 4,294
- 35
- 58
-
Thanks for your answer. This is a good hack. I think I'll be using that until I find a new solution. – maroxe Apr 05 '14 at 14:16