Page 1 of 1

Recursive Sampling

Posted: Mon Dec 02, 2013 3:10 pm
by rmoralesaramburu
Hello, is there an easy way to do this? I want to first define the samples, and then use a loop to make this.

Code: Select all

matrix(60,7) nfp_rec smpl 1961m02 1961m02 !x=@mean(nonfarm_payrolls) for !i=0 to 59 smpl 1961m02+!i 1961m02+!i !y=@mean(nonfarm_payrolls) matrix nfp_rec(!i+1,1)=100*!y/!x next smpl 1970m11 1970m11 !x=@mean(nonfarm_payrolls) for !i=0 to 59 smpl 1970m11+!i 1970m11+!i !y=@mean(nonfarm_payrolls) matrix nfp_rec(!i+1,2)=100*!y/!x next smpl 1975m3 1975m3 !x=@mean(nonfarm_payrolls) for !i=0 to 59 smpl 1975m3+!i 1975m3+!i !y=@mean(nonfarm_payrolls) matrix nfp_rec(!i+1,3)=100*!y/!x next smpl 1982m11 1982m11 !x=@mean(nonfarm_payrolls) for !i=0 to 59 smpl 1982m11+!i 1982m11+!i !y=@mean(nonfarm_payrolls) matrix nfp_rec(!i+1,4)=100*!y/!x next smpl 1991m3 1991m3 !x=@mean(nonfarm_payrolls) for !i=0 to 59 smpl 1991m3+!i 1991m3+!i !y=@mean(nonfarm_payrolls) matrix nfp_rec(!i+1,5)=100*!y/!x next smpl 2001m11 2001m11 !x=@mean(nonfarm_payrolls) for !i=0 to 59 smpl 2001m11+!i 2001m11+!i !y=@mean(nonfarm_payrolls) matrix nfp_rec(!i+1,6)=100*!y/!x next smpl 2009m6 2009m6 !x=@mean(nonfarm_payrolls) for !i=0 to 59 smpl 2009m6+!i 2009m6+!i !y=@mean(nonfarm_payrolls) matrix nfp_rec(!i+1,7)=100*!y/!x next

Re: Recursive Sampling

Posted: Mon Dec 02, 2013 3:17 pm
by EViews Gareth
Perhaps you could define what "this" is?

Re: Recursive Sampling

Posted: Mon Dec 02, 2013 3:50 pm
by rmoralesaramburu
In my last post I wrote a code. I am creating 7 series into a matrix of 60 rows.

I would like to first define the samples, and then loop to generate the 7 series.

For example

sample s1 1961m02 1961m02
sample s2 1970m11 1970m11

then take this definitions inside the loop I am doing in my below post

Re: Recursive Sampling

Posted: Mon Dec 02, 2013 4:04 pm
by EViews Gareth
Well, the problem is that your code is not easy to follow and work out what you want.

I suppose the starting question is, if you already have code that does it, why do you need help?