Outputting wrong estimates

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

ThomasFloe
Posts: 2
Joined: Wed Oct 16, 2013 5:15 am

Outputting wrong estimates

Postby ThomasFloe » Wed Oct 16, 2013 5:23 am

Hi

I've got a problem with regards to the below code. When i run it i get wrong (different) estimates compared to my professor and my fellow students. I have a suspicion that there is something wrong with my rndseed. We all have the same version of eviews and I have even tried reinstalling eviews (8) in order to get rid of this problem. Any ideas?

'Problem set 6: EViews code
!n = 10000 'Number of observations in workle
create Problem_set_6 u 1 !n'Create workle
vector (3) ss'Create vector to contain sample sizes
ss.fill 100, 1000, 10000'Fill in sample sizes
rndseed 123456 'Seed the random number generator to reproduce output
matrix (3,2) probitbeta'Dene matrix to contain results
matrix (3,2) logitbeta'Dene matrix to contain results
genr x =100+@sqr(100)*nrnd 'Generate data
smpl 1 !n
genr eps = nrnd 'Generate innovations
genr ystar = -10 + 0.1*x + eps'Calculate ystar
genr y = (ystar>=0)'Calculate y
for !j=1 to 3'Run loop over sample sizes
!ed = ss(!j)'Pick out the relevant sample size
smpl 1 !ed
equation MLprobit.binary(d=n) y c x'Estimate by least squares
probitbeta(!j,1) = c(1)'Save the intercept coecient
probitbeta(!j,2) = c(2)'Save the slope coecient
equation MLlogit.binary(d=l) y c x'Estimate by least squares
logitbeta(!j,1) = c(1)'Save the intercept coecient
logitbeta(!j,2) = c(2)'Save the slope coecient
next
delete ss x eps y MLprobit MLlogit
show probitbeta
show logitbeta

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Outputting wrong estimates

Postby EViews Gareth » Wed Oct 16, 2013 6:52 am

rndseed is only guaranteed to produce the same results on the same computer. On different machines it can produce different results. Notably machines with a different number of cores.

ThomasFloe
Posts: 2
Joined: Wed Oct 16, 2013 5:15 am

Re: Outputting wrong estimates

Postby ThomasFloe » Fri Oct 18, 2013 2:09 am

Thanks for your answer. What I don't understand is that i used to get the same results, but now, all of the sudden my results differ. Even after I have tried reinstalling. Can I in any way change the rndseed settings?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Outputting wrong estimates

Postby EViews Gareth » Fri Oct 18, 2013 7:55 am

No.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests