nstProbs={};bicProbs={};
plotBIC[prevNum_,numData_,xmean_,ymean_,corr_,xvar_,yvar_]:=
(*Module[{mux=0.001`,muy=0.0001`,n1=prevNum,n=numData,rho=0.9`,varx=.01,vary=1.67},*)
Module[{n1=prevNum,n=numData,mux=xmean,muy=ymean,rho=corr,varx=xvar,vary=yvar},
distN=MultinormalDistribution[{mux,muy},{{(varx/n),rho (Sqrt[((varx vary)/(n n))])},{rho (Sqrt[((varx vary)/(n n))]),(vary/n)}}];ellF=EllipsoidQuantile[distN,0.95`];ellN=EllipsoidQuantile[distN,0.99`];bicOrigin[mu$_]:=((mu$[[3]] ((((mu$[[1]])^2)/varx)+(((mu$[[2]])^2)/vary)-((2 rho mu$[[1]] mu$[[2]])/(Sqrt[varx vary]))))/(1-(rho^2)));bicXAxis[mu$_]:=Log[mu$[[3]]]+((mu$[[3]] ((mu$[[2]])^2))/((1-(rho^2)) vary));bicYAxis[mu$_]:=Log[mu$[[3]]]+((mu$[[3]] ((mu$[[1]])^2))/((1-(rho^2)) varx));bicSector[mu_]:=2 Log[mu[[3]]];Do[dist=MultinormalDistribution[{mux,muy},{{(varx/(Exp[i])),rho (Sqrt[((varx vary)/(Exp[i] Exp[i]))])},{rho (Sqrt[((varx vary)/(Exp[i] Exp[i]))]),(vary/(Exp[i]))}}];r=RandomReal[dist,1000];r=(Append[#1,Exp[i]]&)/@r;bicO=bicOrigin/@r;bicX=bicXAxis/@r;bicY=bicYAxis/@r;bicS=bicSector/@r;pbicOrigin=Mean[Boole[NonNegative[bicS-bicO]] Boole[NonNegative[bicX-bicO]] Boole[NonNegative[bicY-bicO]]];pbicYAxis=Mean[Boole[NonNegative[bicS-bicY]] Boole[NonNegative[bicX-bicY]] Boole[NonNegative[bicO-bicY]]];pbicXAxis=Mean[Boole[NonNegative[bicS-bicX]] Boole[NonNegative[bicY-bicX]] Boole[NonNegative[bicO-bicX]]];pbicSector=1-(pbicOrigin+pbicYAxis+pbicXAxis);pnstOrigin=Mean[Boole[NonNegative[bicS-bicO]]];pnstYAxis=Mean[Boole[NonNegative[bicS-bicY]] Boole[NonNegative[bicX-bicY]] Boole[NonNegative[bicO-bicS]]];pnstXAxis=Mean[Boole[NonNegative[bicS-bicX]] Boole[NonNegative[bicY-bicX]] Boole[NonNegative[bicO-bicS]]];pnstSector=1-(pnstOrigin+pnstYAxis+pnstXAxis);pbic={pbicOrigin,pbicYAxis,pbicXAxis,pbicSector};psector={pnstOrigin,pnstYAxis,pnstXAxis,pnstSector};bicProbs=Append[bicProbs,pbic];nstProbs=Append[nstProbs,psector];,{i,Log[n1],Log[n],0.25`}];bicRetractions=Take[bicProbs,{1,Dimensions[bicProbs][[1]]-1}]-Take[bicProbs,{2,Dimensions[bicProbs][[1]]}];bicRetractions=bicRetractions Boole[NonNegative[bicRetractions]];bicRetractions=Total[bicRetractions];bicORet=N[bicRetractions[[1]]];bicYRet=N[bicRetractions[[2]]];bicXRet=N[bicRetractions[[3]]];bicSRet=N[bicRetractions[[4]]];bicRetractions=N[Total[bicRetractions]];nstRetractions=Take[nstProbs,{1,Dimensions[nstProbs][[1]]-1}]-Take[nstProbs,{2,Dimensions[nstProbs][[1]]}];nstRetractions=nstRetractions Boole[NonNegative[nstRetractions]];nstRetractions=Total[nstRetractions];nstORet=N[nstRetractions[[1]]];nstYRet=N[nstRetractions[[2]]];nstXRet=N[nstRetractions[[3]]];nstSRet=N[nstRetractions[[4]]];nstRetractions=N[Total[nstRetractions]];

g=Grid[{{Show[RegionPlot[{bicOrigin[{x,y,n}]<bicSector[{x,y,n}]&&bicOrigin[{x,y,n}]<bicYAxis[{x,y,n}]&&bicOrigin[{x,y,n}]<bicXAxis[{x,y,n}],bicYAxis[{x,y,n}]<bicSector[{x,y,n}]&&bicYAxis[{x,y,n}]<bicOrigin[{x,y,n}]&&bicYAxis[{x,y,n}]<bicXAxis[{x,y,n}],bicXAxis[{x,y,n}]<bicSector[{x,y,n}]&&bicXAxis[{x,y,n}]<bicOrigin[{x,y,n}]&&bicXAxis[{x,y,n}]<bicYAxis[{x,y,n}],bicSector[{x,y,n}]<bicOrigin[{x,y,n}]&&bicSector[{x,y,n}]<bicXAxis[{x,y,n}]&&bicSector[{x,y,n}]<bicYAxis[{x,y,n}]},{x,xbounds[ellN][[2]],xbounds[ellN][[3]]},{y,ybounds[ellN][[2]],ybounds[ellN][[3]]},ImageSize->300],Graphics[ellF],Graphics[ellN]],ListLinePlot[{bicProbs[[All,1]],bicProbs[[All,2]],bicProbs[[All,3]],bicProbs[[All,4]]},PlotLabel->{bicRetractions},PlotLegends->{bicORet,bicYRet,bicXRet,bicSRet},ImageSize->450]}}];(*Grid[{{Show[RegionPlot[{bicOrigin[{x,y,n}]<bicSector[{x,y,n}]&&bicOrigin[{x,y,n}]<bicYAxis[{x,y,n}]&&bicOrigin[{x,y,n}]<bicXAxis[{x,y,n}],bicYAxis[{x,y,n}]<bicSector[{x,y,n}]&&bicYAxis[{x,y,n}]<bicOrigin[{x,y,n}]&&bicYAxis[{x,y,n}]<bicXAxis[{x,y,n}],bicXAxis[{x,y,n}]<bicSector[{x,y,n}]&&bicXAxis[{x,y,n}]<bicOrigin[{x,y,n}]&&bicXAxis[{x,y,n}]<bicYAxis[{x,y,n}]},{x,xbounds[ellN][[2]],xbounds[ellN][[3]]},{y,ybounds[ellN][[2]],ybounds[ellN][[3]]},ImageSize->300],Graphics[ellF],Graphics[ellN]],ListLinePlot[{bicProbs[[All,1]],bicProbs[[All,2]],bicProbs[[All,3]],bicProbs[[All,4]]},PlotLabel->{bicRetractions},PlotLegends->{bicORet,bicYRet,bicXRet,bicSRet},ImageSize->450]},{Show[RegionPlot[{bicOrigin[{x,y,n}]<bicSector[{x,y,n}],bicOrigin[{x,y,n}]>bicSector[{x,y,n}]&&bicYAxis[{x,y,n}]<bicSector[{x,y,n}]&&bicYAxis[{x,y,n}]<bicXAxis[{x,y,n}],bicOrigin[{x,y,n}]>bicSector[{x,y,n}]&&bicXAxis[{x,y,n}]<bicSector[{x,y,n}]&&bicXAxis[{x,y,n}]<bicYAxis[{x,y,n}]},{x,xbounds[ellN][[2]],xbounds[ellN][[3]]},{y,ybounds[ellN][[2]],ybounds[ellN][[3]]},ImageSize->300],Graphics[ellF],Graphics[ellN]],ListLinePlot[{nstProbs[[All,1]],nstProbs[[All,2]],nstProbs[[All,3]],nstProbs[[All,4]]},PlotLabel->{nstRetractions},PlotLegends->{nstORet,nstYRet,nstXRet,nstSRet},ImageSize->450]}}];*)
g
];

(*frames=Table[plotPic[Exp[(n-1)/4],Exp[n/4],0.001,0.0001,0.9,.01,1.67],{n,11,120}];
ListAnimate[frames]
Export["bic.gif",frames]*)

frames=Table[plotBIC[Exp[(n-1)/4],Exp[n/4],0.001,0.0001,0,1,1],{n,11,120}];
Export["bicNoCorr.gif",frames]