
'define matrix results
matrix(100000,10) results
scalar i=0

'!c(1) = define variable for beta coefficient 
for !c1=0.008 to 0.1 step 0.01
'!c(2) = define variable for alpha coefficient
	for !c2=0.1 to 0.95 step 0.1
'!c(3) = define variable for theta coefficient 
		for !c3=0.1 to 0.95 step 0.1
'!c(4) = define variable for phi coefficient
			for !c4=-1 to 1 step 0.4
'!c(5) = define variable for beta1 coefficient
				for !c5=0.1 to 0.95 step 0.1

'matrix row numbers 
i=i+1

'assign starting values to coefficient vector.
c(1)=!c1
c(2)=!c2
c(3)=!c3
c(4)=!c4
c(5)=!c5

'record starting values in matrix 
results(i,1)=!c1
results(i,2)=!c2
results(i,3)=!c3
results(i,4)=!c4
results(i,5)=!c5

'NLS estimation
equation nls.ls log(y) = (((1-exp(-c(1)*@trend))*c(2)*(1-c(3))*log(s))+((1-exp(-c(1)*@trend))*c(5)*log(l))+((1-exp(-c(1)*@trend))*c(4)*log(fi))+((1-exp(-c(1)*@trend))*log(gamma+(1-c(2))*c(5)*n))+((1-exp(-c(1)*@trend))*c(2)*(1-c(3))*log((n+delta)+(c(5)*n)))+((exp(-c(1)*@trend))*log(y(-1))))



'assign variables to converged values of coefficients in NLS estimation
!co1=nls.@coefs(1)
!co2=nls.@coefs(2)
!co3=nls.@coefs(3)
!co4=nls.@coefs(4)
!co5=nls.@coefs(5)

'record them to the matrix
results(i,6)=!co1
results(i,7)=!co2
results(i,8)=!co3
results(i,9)=!co4
results(i,10)=!co5

next
	next
		next
			next
				next


