AdvancedStatisticalAnalysisHomework4DueonFriday,December16,2016Problem1.PleaseinterprettheRcodebelow,andaddcomprehensivecommentforeachlineofthecode(startwith#).SLim_sq-functionxsumx-iDeanx;2)bestcut-functiony3xn=length工y=yorderzx=sortxsd_s-u()foriin1n-1sd_sii=sunyx-xi)4-suni_sqy:kxicxwhichtsd_s=iDinsd_s13minisd_sreg_treeJi_inctiony,1eve1=0/min_s=5ifis.matrix,x_nix_nFmatrixncol=l-n_p=diir!x_m2res-matrixnrowii-Pjncol=2)foriin1n_presij=bestcuty3x_inJic