Search found 479 matches

by EViews Matt
Thu Feb 04, 2021 8:13 am
Forum: Programming
Topic: looping through an alpha series
Replies: 4
Views: 243

Re: looping through an alpha series

Right, the show command is predominantly used for displaying entire objects rather than individual elements. As such, ( ) notation is interpreted as lag notation rather than element-of notation. Any normal non-genr expression works as intended, as you discovered.
by EViews Matt
Wed Feb 03, 2021 4:55 pm
Forum: Programming
Topic: looping through an alpha series
Replies: 4
Views: 243

Re: looping through an alpha series

Hello, If what you're ultimately after is a string containing the data in an alpha series, you can generate that with a single expression, %names = @wjoin(@convert(alpha_series_name)) Otherwise, if you actually need to loop through the alpha series to perform other work, you can in a number of ways....
by EViews Matt
Tue Feb 02, 2021 11:47 am
Forum: Programming
Topic: Editing adjust series via program
Replies: 5
Views: 388

Re: Editing adjust series via program

The model's reinclude procedure will automatically create/update an add factor for the reincluded variable such that the solved values of the model will not change after the reinclude. Naturally, this will overwrite any preexisting add factor (or its override) for that variable. Alternatively, you c...
by EViews Matt
Tue Jan 26, 2021 10:07 am
Forum: Program Repository
Topic: Random draws from multivariate normal distribution
Replies: 9
Views: 18282

Re: Random draws from multivariate normal distribution

Hello,

Your posted code with the declaration of S changed to type sym runs successfully for me. What is the error or failure you're observing?
by EViews Matt
Mon Jan 25, 2021 2:52 pm
Forum: Programming
Topic: How to build a matrix to store coefficients?
Replies: 2
Views: 190

Re: How to build a matrix to store coefficients?

Hello, There's really only two changes needed fix your existing code. First, you don't need to be creating the coefs matrix on every iteration of the loops, that should be done just once before the loops. The number of columns in the matrix can be directly calculated, i.e. 12 * 19 = 228. Second, whe...
by EViews Matt
Mon Jan 25, 2021 2:31 pm
Forum: Programming
Topic: How to create subsamples by date in batch?
Replies: 5
Views: 327

Re: How to create subsamples by date in batch?

Hello,

You can include a series statement in the for loop to create the series, but the details will depend on how you want to name and optionally initialize the series (???).

Code: Select all

for !i=1 to 240
     smpl 2000m1+!i-1 2000m1+!i-1
     series ??? = ???
next
by EViews Matt
Mon Jan 25, 2021 2:27 pm
Forum: Programming
Topic: Scalar names in table
Replies: 2
Views: 183

Re: Scalar names in table

Hello,

Sure, here's a small example.

Code: Select all

create u 1
table(3,2) t
t(1,1) = "x"
t(2,1) = "y"
t(3,1) = "z"
t(1,2) = 1
t(2,2) = 2
t(3,2) = 3

for !i = 1 to t.@rows
   %name = t(!i,1)
   scalar {%name} = @val(t(!i,2))
next
by EViews Matt
Mon Jan 25, 2021 12:28 pm
Forum: Programming
Topic: Editing adjust series via program
Replies: 5
Views: 388

Re: Editing adjust series via program

Hello, You can create add factor series programmatically like any other series. Just make sure you're not overwriting such series before you use them as part of your model solution. Continuing your example of variable y in a scenario with alias _1, once you set a variable to use an add factor (y_a) ...
by EViews Matt
Wed Jan 20, 2021 11:55 am
Forum: Programming
Topic: weekday vs weekend average
Replies: 5
Views: 327

Re: weekday vs weekend average

With the simplifying assumptions that a week begins on Monday and year boundaries should be ignored, I believe the following will work:

Code: Select all

series dummy = @meansby(x, @date-@weekday, "if @weekday > 5") > @meansby(x, @date-@weekday, "if @weekday <= 5")
by EViews Matt
Wed Jan 20, 2021 10:51 am
Forum: Programming
Topic: weekday vs weekend average
Replies: 5
Views: 327

Re: weekday vs weekend average

Hello,

You have the right idea, which can be simplified to something of the form:

Code: Select all

series dummy = @mean(x, "if @weekday > 5") > @mean(x, "if @weekday <= 5")
by EViews Matt
Tue Jan 19, 2021 6:33 pm
Forum: Programming
Topic: Programming a cumulative sum function that works in a model object
Replies: 4
Views: 546

Re: Programming a cumulative sum function that works in a model object

After thinking about this issue for a while, I believe there's a tolerable workaround so long as your model doesn't contain any leads and your solution sample is contiguous (no gaps). Try specifying your cumulative sum series as: {modelname}.append y_plus = @nan(y_plus(-1), @cumsum(dlog_y_plus(-1)))...
by EViews Matt
Sat Jan 16, 2021 10:00 am
Forum: Programming
Topic: Programming a cumulative sum function that works in a model object
Replies: 4
Views: 546

Re: Programming a cumulative sum function that works in a model object

Hello, You're quite right, functions such as @sum and @cumsum do not operate on endogenous variables as you'd expect. Basically, the value of those functions is calculated only once at the beginning of a solve operation, ignoring any subsequent changes made to the endogenous variables over the cours...
by EViews Matt
Tue Jan 05, 2021 6:06 pm
Forum: Estimation
Topic: Blanchard and Perotti SVAR model
Replies: 3
Views: 588

Re: Blanchard and Perotti SVAR model

I'm a bit confused by your follow up. Have you successfully estimated all the coefficients in the A and B matrices?
by EViews Matt
Tue Jan 05, 2021 2:02 pm
Forum: Programming
Topic: Print output to console or text file
Replies: 1
Views: 1823

Re: Print output to console or text file

Hello,

Take a look at the 'logmode' and 'logmsg' commands.
by EViews Matt
Tue Jan 05, 2021 1:55 pm
Forum: Estimation
Topic: Blanchard and Perotti SVAR model
Replies: 3
Views: 588

Re: Blanchard and Perotti SVAR model

Hello, So you have a standard VAR estimated and your custom A and B matrices, correct? If so, you can form the short-term response matrix S from A and B, extract the structural shock you're interested in from S, and then use that custom shock with the VAR object's impulse response procedure. Program...

Go to advanced search