I am struggling with the Monte Carlo integral problem in R.
y= x^2+cos(x); for x= [0,2]
I am supposed to use HitMiss <- function(T,S,method="halton") to solve this problem. T is the number of trails run per sample size in S. S is number of sample points
The function should return T*|S| matrix, |S| is length of S.
Please help me out and give me some clue on solving this problem. Really appreciate it!!!