Cumulative Series of MC Simulations

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

27npg
Posts: 29
Joined: Thu Jul 25, 2019 9:31 am

Cumulative Series of MC Simulations

Postby 27npg » Wed Aug 21, 2019 4:20 pm

Hi,

I have a series of 10000 MC simulations of growth rates for 5 years 2013, 2014, 2015, 2016, 2017. I want to create a series of the cumulative growth rate over the 5 year period for each simulation (i.e a series of 2000 cumulative growth rates). Any idea of options to do this?

Thanks!

EViews Matt
EViews Developer
Posts: 562
Joined: Thu Apr 25, 2013 7:48 pm

Re: Cumulative Series of MC Simulations

Postby EViews Matt » Thu Aug 22, 2019 9:21 am

Hello,

Could you elaborate on how your data is currently organized?

27npg
Posts: 29
Joined: Thu Jul 25, 2019 9:31 am

Re: Cumulative Series of MC Simulations

Postby 27npg » Thu Aug 22, 2019 12:32 pm

Hi Matt - thanks for getting back to me. Yes - the MC simulations are in a separate tab so there is 10000 series of say

1 - 2013 8.6
1- 2014. 6.1
1- 2015. 5.3
1- 2016. 4.7
1- 2017. 5.1
2- 2013. 4.9
2- 2014 .......

I basically want to get distribution of of the 5 year cumulative growth rates based on simulations.

Any ideas ?

EViews Matt
EViews Developer
Posts: 562
Joined: Thu Apr 25, 2013 7:48 pm

Re: Cumulative Series of MC Simulations

Postby EViews Matt » Thu Aug 22, 2019 2:26 pm

To begin, you can create a series that holds the cumulative growth for all years ("x" is your growth series):

Code: Select all

series cum_growth = @recode(@mod(@obsid, 5) = 1, x, 100 * ((1 + cum_growth(-1) / 100) * (1 + x / 100) - 1))

Since you're only interested in the cumulative growth in the last year (every fifth observation), it's probably easiest to first copy that subset of the above series to a vector and then copy the vector into your new, smaller series on a different page.

27npg
Posts: 29
Joined: Thu Jul 25, 2019 9:31 am

Re: Cumulative Series of MC Simulations

Postby 27npg » Fri Aug 23, 2019 12:38 am

You’re a star Matt! Thanks so much for this. Much appreciated


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 11 guests