Hi,
I am new to Eviews and want some help with the resample function.
If possible I want to create 1,000 resamples from an original sample (series) that has 5,000 observations. I also want each resample to be a separate series, or preferably for all the resamples to form a single matrix (i.e. 1000x5000).
If anyone is able to point me in the right direction that would be much appreciated.
Resample
Moderators: EViews Gareth, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Resample
Have to use a program. Here's an example:
Code: Select all
create u 5000
series x=nrnd
'resample 1,000 times.
for !i=1 to 1000
x.resample x!i
next
Follow us on Twitter @IHSEViews
Re: Resample
Thanks, that's great just what I needed.
Re: Resample
Hi, I have similar problem, but in my case I'm resampling with block size=30. So some part of the code is as follows:
rndseed 12345
series open
matrix(1,1563) m1
stom(open,m1)
!nreps=1000
matrix (1563,1000) x
for !i = 1 to !nreps
@resample (m1,0,30)
next
The problem is I can't store samples from each iteration. I guess it should be something like this in the loop, but it doesn't work:
'store coefficients into matrix
colplace(resample, resample.@resample, !i)
Could you please advice on that, Thanks!
rndseed 12345
series open
matrix(1,1563) m1
stom(open,m1)
!nreps=1000
matrix (1563,1000) x
for !i = 1 to !nreps
@resample (m1,0,30)
next
The problem is I can't store samples from each iteration. I guess it should be something like this in the loop, but it doesn't work:
'store coefficients into matrix
colplace(resample, resample.@resample, !i)
Could you please advice on that, Thanks!
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Resample
You have to set a matrix equal to the one you're resample
Code: Select all
matrix m2 = @resample(m1,0,30)
Follow us on Twitter @IHSEViews
Re: Resample
Hi,
Thanks for your prompt reply EViews Gareth.
I've tried the code with new matrix m2 but know it saves only one resampled sample, so that there is only one column of the data. I wonder what I'm doing wrong?
Thanks for your prompt reply EViews Gareth.
I've tried the code with new matrix m2 but know it saves only one resampled sample, so that there is only one column of the data. I wonder what I'm doing wrong?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Resample
So, it's impossible to have all resampled samples in one matrix at once and I have to do it for 1000 iterations and the loop should contain all 1000 matrices. How can I group all matrices obtained then, because I have to transfer this data into excel (hope this procedure will work at once)
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Resample
Use the matplace, or the vcat function to merge the matrices into a bigger one
Follow us on Twitter @IHSEViews
Return to “General Information and Tips and Tricks”
Who is online
Users browsing this forum: No registered users and 23 guests