sbenthall / SHARKFin

Simulating Heterogeneous Agents with Finance
7 stars 5 forks source link

Remove runs-per-quarter functionality #130

Open mesalas opened 2 years ago

mesalas commented 2 years ago

Sharkfin sends increasingly large dividends to ammps. Ill investigate and provide more info

mesalas commented 2 years ago

@sbenthall : I think I understand this better now.

I was running with quarters=1 and runs=10, which I thought would give a run of 10 days. But as far as I can see SHARFin actually simulated 60 days (because thats the length of a quarter) but only calls the market (in this case ammps) every 60/10 = 6 days, in between that SHAKRFin is doing dummy runs. Thats why the list of dividends was much longer than I expected.

Im not quite sure I understand why this makes the dividend process blow up, but Im also doing something that im not supposed to do, so its not reasonable to expect this would work.

As we/I are assuming a 1:1 correspondence between "ammps days" and "sharkfin runs" the shortest amount of time we can currently run the ammps/sharkfin pair is 60 days, ie one quarter. My initial testing was using 2 quarters and 60 runs per quarter (120 days) and that worked out fine. However, I changed to 1 quarter and 10 runs because I wanted to test what happened when the simulation reached its conclusion.

This illustrates that we have to be careful when setting the simulation length. making sure we target days_per_run = 1.

sbenthall commented 2 years ago

When there are fewer runs than days per quarter, each day the price change from the most recent return is compounded. It's possible that a high rate of return gets compounded a lot, increasing in size each day.

This was originally set up to allow for testing when there was an expensive simulation that we didn't want to run locally all the time. But now that we have a fast MockMarket, it may be that this feature is more confusing that it's worth to maintain.

We currently have 60 days per quarter hard-coded in, with a variable number of runs per quarter. 10 runs per quarter means each market return value is repeated for 6 days. It sounds like you would prefer it if there were a variable number of days per quarter, so it would be possible to test, say, 2 quarters of 10 days each, and run it to completion?

We can discuss the best new design for this, but if it's not blocking things for now I'd like to pushing this ticket to a later release, as we are quite late on delivering White Shark.