Simulating Price Processes

58 views
Skip to first unread message

Jason Smolensky

unread,
Oct 17, 2025, 5:37:09 PMOct 17
to JaamSim Users Discussion Group
Hello all, 
This is probably a very basic question but has anyone here simulated a price process or any other sort of random walk where the value is update over time through the course of the simulation?

The following parameters for this model are:

Price at time 0
Long term Price
Std Dev of Price Returns (AKA volatility)
Risk free rate
Mean reversion speed

At every time step a price return is calculated by sampling a normal distribution.  This return is then used to update the price from the last time step.

Appreciate if anyone can guide me here as to which object to use (I was originally thinking Expression Entity, but the value here needs to be updated based on a controller and Expression Entity doesn't have controller as an input).

Best,

Jason Smolensky

Harry King

unread,
Oct 17, 2025, 5:43:36 PMOct 17
to JaamSim Users Discussion Group
Hi Jason,

Use a UnitDelay object along with the Controller to sample the NormalDistribution at regular intervals. The UnitDelay holds the value from an expression until it is updated by the Controller.

Harry

Jason Smolensky

unread,
Oct 21, 2025, 4:51:19 PMOct 21
to JaamSim Users Discussion Group
Hi All,

With Harry's help I was able to solve this.  

Simulating price processes are important for evaluating financial decisions, e.g. how could I best hedge the throughput of my system if it's exposed to spot prices, or what would be the impact of using debt vs. equity financing (debt has the advantage that it doesn't dilute equity but also runs the risk that if prices drop, you might not be able to make the interest payment and might default).  Superimposing a price process onto a commodity simulation can help you quantify these types of risks.

In case anyone else is interested I've attached a .cfg  file that models a single realization of  two price processes:

1) Geometric Brownian Motion (https://en.wikipedia.org/wiki/Geometric_Brownian_motion) - Often used to model stock prices.

2) Orstein-Uhlenbeck (https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process - A mean reverting process, often used to model commodity prices where the long term price is given by a forward/futures market.

Best Regards,

Jason Smolensky

PriceProcess.cfg

Peter Stumpf

unread,
Oct 22, 2025, 7:59:52 AMOct 22
to JaamSim Users Discussion Group
Dear Jason

that is very interesting. 
Since I thought about simulating the price process at the european electric power market.
But I'm not a "financial expert", only an expert concerning battery storage systems and pv-systems.
 
If you are a financial expert:
What algorithms would you suggest to me, to try?

Kind regards
Peter

Peter Stumpf

unread,
Oct 22, 2025, 8:08:01 AMOct 22
to JaamSim Users Discussion Group
Hi All
has anyone tried this with JaamSim?

@ Harry:
Which components would you suggest to give that "electrical simulation" a try? The fluid components of JaamSim?

Thanks in advance!
Peter

Jason Smolensky

unread,
Oct 23, 2025, 8:17:21 PMOct 23
to JaamSim Users Discussion Group
Hi Peter,

Apologies, I thought I answered this earlier but somehow the message wasn't posted.

I have seen different prices processes for power markets.  The "old fashioned" way that I remember is to use a similar equation to Ornstein-Ulhenbeck but with a "jump " term that accounts for outages or sudden demand spikes.

More commonly these days  many of the models include risk factors that account for fundamental drivers, e.g. weather, economics, etc..  As well, price movements in electricity markets are strongly affected by the jurisdiction.  For example in many jurisdictions there are caps on the price which must be taken into account.  

If you want to take a deep dive on the topic, I recommend this textbook:


Good Luck!

Jason

Reply all
Reply to author
Forward
0 new messages