## Search found 313 matches

Mon Dec 10, 2018 10:20 am
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

My point is that the estimates you're evaluating to find the best combination of lags (the "equation eq{!i}.ls" line) and the estimate you're using to record the results for the best combination (the "show eq{!i}.ls" line) do not match. In the former you use the "to" la...
Sun Dec 09, 2018 7:21 am
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

That combination of lags isn't one that your program evaluates, so of course the program cannot identify it as the best. Take a close look at your primary estimation line, the line beginning with "equation eq{!i}.ls".
Fri Dec 07, 2018 10:21 am
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

You could explicitly record which of those three cases (0, 1, or 2 p-values < 0.1) you're in, and the logic to transition between them, but lets try a little numerical trick. Replace all of the if logic with, !fake_aic = eq{!i}.@aic - 1000 * ((eq{!i}.@pval(2) < !pval_C) + (eq{!i}.@pval(3) < !pval_D)...
Thu Dec 06, 2018 3:31 pm
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

There's an error because you've used [] brackets instead of () parentheses to indicate subexpressions. The combined logic of those three if clauses effectively ignores the p-values. As long as the AIC of the equation is better than any previously seen, one of the three clause conditions will be true...
Thu Dec 06, 2018 10:21 am
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

Hello, It appears that all you're missing is to update variable !aic when you find a new best AIC. if eq{!i}.@pval(2) < !pval_C and eq{!i}.@pval(3) < !pval_D and eq{!i}.@aic < !aic then !aic = eq{!i}.@aic !bestlag_a = (!lag_a) !bestlag_b = (!lag_b) ... If !pval_C and !pval_D are initialized to 0.1, ...
Mon Nov 26, 2018 10:40 am
Forum: Programming
Topic: Speeding up simulations
Replies: 5
Views: 1622

### Re: Speeding up simulations

Hello, In addition to startz's recommendations, you can also perform a simple experiment to determine whether running simulations in parallel would provide any performance benefit. Run one of the simulations and observe the CPU usage. If the usage is 50%-100%, then EViews is already using multiple c...
Tue Nov 20, 2018 3:57 pm
Forum: Programming
Topic: Merging coefficient in series (Updated) - Not correct mean
Replies: 12
Views: 480

### Re: Merging coefficient in series (Updated) - Not correct mean

Of course, we've lost two degrees of freedom, that's the correction! Adjusting the original author's variance calculation now produces the expected result,

Code: Select all

`sevec(!i) =  @sumsq(resid - @mean(resid)) / (@obsrange - 2)`
Tue Nov 20, 2018 3:14 pm
Forum: Programming
Topic: Merging coefficient in series (Updated) - Not correct mean
Replies: 12
Views: 480

### Re: Merging coefficient in series (Updated) - Not correct mean

No, the series are very short (following the OP's example), only of length n . The 10,000 is the number of iterations for building the expectation (i.e. Monte Carlo runs). So, for example, drawing 3 Y's from N(0, 4), regressing, and calculating the variance of the residuals 10,000 times results in a...
Tue Nov 20, 2018 2:30 pm
Forum: Programming
Topic: Merging coefficient in series (Updated) - Not correct mean
Replies: 12
Views: 480

### Re: Merging coefficient in series (Updated) - Not correct mean

Created a small EViews program (further below) to explore the expected residual variance for different sample sizes. I believe this shows the same numerical phenomenon that underlays the original poster's question. ExpVar.png The generating program: create u 19 !iterations = 10000 series n = @trend ...
Tue Nov 20, 2018 9:49 am
Forum: Programming
Topic: Merging coefficient in series (Updated) - Not correct mean
Replies: 12
Views: 480

### Re: Merging coefficient in series (Updated) - Not correct mean

Something about this is bothering me. Shouldn't the expected variance of the residuals asymptotically approach (from below) the true variance of the generating process (as written in the original author's script) as the sample size increases? The extreme boundary example is n = 2, where the residual...
Mon Nov 19, 2018 2:16 pm
Forum: Programming
Topic: Merging coefficient in series (Updated) - Not correct mean
Replies: 12
Views: 480

### Re: Merging coefficient in series (Updated) - Not correct mean

Hello,

I believe you're just observing the consequences of a small sample size. Try increasing the number of points from 10 to, say, 100.
Thu Nov 15, 2018 10:08 am
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

You can test your code by manually determining which lags should be selected (at least for part of your dataset) and comparing that expectation to the results of your program. That said, just looking at your code I notice that you may not have considered what to do if there isn't a "best" ...
Tue Nov 13, 2018 10:50 am
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

Moving where you initialize !aic to just inside the !i loop should be sufficient.
Tue Nov 13, 2018 10:15 am
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

The issue is actually occurring earlier in your program, eq4 doesn't have the best lag chosen correctly either. The reason is hinted at in the second bullet point of my previous post. More specifically, what will your program do if the best AIC for an equation is worse (larger) then the best AIC for...
Thu Nov 08, 2018 10:26 am
Forum: Programming
Topic: ERRORHELP
Replies: 42
Views: 14498

### Re: ERRORHELP

Your code is getting closer to what you want. Here are two more tips: ⋅  When you rerun the estimation with the best lags (as part of the show command), make sure you use the correct estimation specification. ⋅  It appears that you want to determine the best set of lags for each ...