[Solved] Object not found in for loop
The problem in the peace of code below after your definition of crra function: eua = c(pa1*crra(a1,r)+pa2*crra(a2,r)) eub = c(pb1*crra(b1,r)+pb2*crra(b2,r)) Basically you are trying to use r variable before it’s defined moreover it is a duplicate of the code inside the for-loop. If you comment out these two lines everything goes OK. Please see the … Read more