“…, sigma , beta , p , a , t0 , x0 , T , psi )46 BP = BranchingProcess ( mu , sigma , beta , p , t0 , x0 , T ); * ( a ( k )/ p ( k ) )^( BP {2}( k ) );55 elseif a ( k )~= 0 56 error ( 'a ( k ) zero but p ( k ) non -zero ' ); , sigma , beta , p , t0 , x0 , T ) 64 BP = cell (2 ,1); 65 BP {2} = p *0; 66 tau = exprnd (1/ beta ); 67 new_t0 = min ( tau + t0 , T ); 68 delta_t = new_t0 -t0 ; 69 m = size ( sigma ,2); 70 new_x0 = x0 + mu * delta_t + sigma * sqrt ( delta_t )* randn (m ,1); tmp , wh ic h_ no nl in ea ri ty ] = max ( mnrnd (1 , p )); 75 BP {2}( w hi ch _n on li ne ar it y ) = BP {2}( whi ch _n on li ne ar it y ) + 1; 76 for k =1: which_nonlinearity -1 77 tmp = BranchingProcess (... 78 mu , sigma , beta , p , new_t0 , new_x0 , T ); 79 BP {1} = [ BP {1} tmp {1} ]; 80 BP {2} = BP {2} + tmp {2}; 81 end Matlab code 2: A Matlab code for the Branching diffusion method used in Subsection 4.5. Python code for the deep 2BSDE method used in Subsection 4The following Python code is based on the Python code in E, Han, & Jentzen [33, Subsection 6.1].…”