program mfort
	use analyticalIS
	use compute
	implicit none
	integer	:: i

	
	call openML
	call execinML("close all")
	
	call rnset(126546)
!$omp parallel do
	do i=1,100
		call rnset(3491284*i)
	enddo
	call inittime

	call setanaIS		! generate points for importance sampling using algorithm desribed in Mueller and Watson, Handbook of Econometrics draft
						! unnecessarily complicated for p0=1, but could be made to work also for p0=2

	thlist1=loadmat("c:/dropbox/mystuff/beyondltu/revision/altweight"//convtos(p1)//".txt")
	call setfs
	call printtime
	call loaddata
	level=0.05
	call setlam
	call testydata
	call printtime
	level=0.01
	call setlam
	call testydata
	call printtime
end program