The Cognitive Radio Network, incorporating Device-to-Device communication and a heterogeneous network, has garnered significant attention due to its ability to address spectrum shortage issues and optimize the efficient utilization of spectrum resources. However, resource allocation considering stochastic behavior has not been considered in existing studies. In this paper, our work aimed to maximize the throughput of the overall network considering multiple users under the umbrella of the Cognitive radio network assisted by amplify and forward relay. The constraints are treated as chance constraints with a probability of satisfaction in them, which leads to a non-convex mixed integer nonlinear problem which is an NP-Hard problem. To solve this problem an exhaustive search solution for optimal results is required. However, the computational burden always increases with the user equipment. Therefore, to obtain an optimal solution with having low computational burden, the Outer Approximation Algorithm is utilized in this research. To evaluate the desired results, extensive simulations have been carried out. The effectiveness of the proposed algorithm is verified by results in terms of throughput maximization under the impact of chance constraint formulation in the cognitive radio networks.