Skip to content
Prev 139904 / 398502 Next

How to remove double loop?

Read the posting guide (the bit about reproducible code):
+     OVal[i+1, n+1] <- max(Val[i+1, n+1]-K, 0)
+ }
Error: object "Val" not found
+     for(j in 0:(i-1)){
+         OVal[j+1, i] <- a*((1-p)*OVal[j+1, i+1]+p*OVal[j+2, i+1])
+     }
+ }
Error: object "p" not found

        
On Thu, 20 Mar 2008, Jonas Malmros wrote: