Subsetting a Time Series

Answered

Comments

5 comments

  • Avatar
    Jason

    Koda,

    Thanks for posting in the GoldSim Forum! This is an interesting question. I built a simple model that might do what you are talking about (see link below). What I do is create an expression that outputs a lookup time value that I can give the time series to return the value at that time as you walk through the simulation. Using an integrator element, we can just reset the value when we are ready to wrap back to the beginning of the time series. The model looks like this:

    I created a Data element where you enter the wrap duration (1 yr, 5 yr, 10 yr, etc) then you figure out when to wrap by integrating the simulation time until you get to the wrap duration you want. Then you calculate the index date and reset that from the previous reset_duration. The index duration starts at 1/1/1920 then increments forward until the duration you want. When you hit the duration, it wraps back to 1/1/1920 again. This can be repeated for as many years as you want. The plot below shows a comparison of the different durations (assuming I want to look at a time series of a drought index). I use Scenarios to show the comparison. 

    Link:

    https://goldsim.sharefile.com/d-s94f70b4fd7a4adf8

    Does this help?

    -Jason

    1
    Comment actions Permalink
  • Avatar
    Koda Merkley

    Jason, 

    That did just what I needed it to and was unable to figure out a solution for. It only took a couple of things to adapt it to my model. 

    What I did was time shifted the time series so the begging of the years I wanted matched the simulation start date and changed the Start_Date to the simulation start date. 

    I am also using realizations on this model to advance one climate year at a time so I added the modulus of the Realization (minus one) by the Wrap_Duration to start date. 

    Again, thank you much it was very helpful. 

    -Koda

    0
    Comment actions Permalink
  • Avatar
    Jason

    I'm this helped. Why do you need to switch from 1yr, 5yr, 10yr wrapping durations? This isn't something I've seen before.

    0
    Comment actions Permalink
  • Avatar
    Koda Merkley

    For the most part it is an attempt at assessing above average, average, and below average precipitation conditions. Three 14yr periods were selected to represent each and recycled across a mine plans to simulate it. There was also three single years selected for the highest, lowest, and an average year on record. Finally I want to be able to run the entire series or any portion of it so a user selectable length was ideal. 

    1
    Comment actions Permalink
  • Avatar
    Jason

    Ah okay that makes sense. Perhaps this is worthy of adding to our library if I can generalize it a bit more. Thanks for sharing and let us know if you run into any other questions.

    -Jason

    0
    Comment actions Permalink

Please sign in to leave a comment.