0

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 enter image description here ? I am aware of the existence of integrate, but this function works only with scalar functions. thank you in advance

maroxe
  • 2,057
  • 4
  • 22
  • 30

1 Answers1

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