A stochastic system is a system which state depends or some random elements making its behavior non-deterministic. Questions with this tag should cover topics regarding random variables and non-determenistic systems.
Questions tagged [stochastic]
256 questions
1
vote
1 answer
Is there room to further optimize the stochastic_rk Fortran 90 code?
I need to use a Fortran code to solve stochastic differential equation (SDE).
I looked at the famous Fortran code website by Burkardt,
https://people.math.sc.edu/Burkardt/f_src/stochastic_rk/stochastic_rk.html
I particular looked at the rk4_ti_step…

CRquantum
- 546
- 3
- 14
1
vote
0 answers
Custom Negative Loss Likelihood returning NaN's after varying numbers of training
Hello StackOverflow people,
I am encountering a problem where I don't know what else I can try. First off, I am using a custom loss function (at least I believe that is the problem, but maybe it's something different?) for a mixture density…

Patrick Lehnen
- 80
- 5
1
vote
0 answers
How to include time-varying parameters in a Gillespie simulation?
I've been simulating a population dynamics model, and added in some environmental stochasticity by making the value of one of the parameters time-varying.
(To be more specific, I made thermal performance curves that relate the temperature of the…

MadelineJC
- 97
- 7
1
vote
1 answer
Double precision in 64 vs 32 bit Excel
I'm wondering if Excel VBA stores doubles with different levels of precision in 32 vs 64 bit editions of the product.
The reason I'm asking is that I'm looking at a stochastic model, and I've noted that I'm getting very small differences in output…

NWhittle
- 131
- 5
1
vote
1 answer
How do you find unknowns inside distribution functions in R?
I need to find the mean in for example
0.02 <- pnorm(400, mean = x, sd = 4)
how do I find x? Is R capable of solving equations?

Fenrir
- 231
- 2
- 18
1
vote
0 answers
Producing Gillespie Model Simulation
I am working in Python and I am trying to reproduce the Gillespie Stochastic Simulation with loops. I so far I coded below. I need to add a loop that runs through the Schematic of the stochastic simulation.
Also- I need to add reactions per dot. I…

danicath0404
- 23
- 2
1
vote
1 answer
CM_Stochastic Highlight Bars by Chris Moody : how can I code "higher high"and "lower low"?
I am attempting to add a specific alert system for the CM_Stochastic Highlight Bars indicator by Chris Moody, to get notified when
1) a crossUpAll is higher than the former one
2) a crossDownAll is lower than the former one
I have written this but…

Jordan
- 11
- 1
1
vote
0 answers
Stochastic Gradient Decent for L2 Log Regression
I was trying to code SGD for L2 Log Regression in Python. But my avg loss is remaining almost the same for every epoch. Can some one help me out with the code.
Code:
Function to predict the Y
def predict(row, coefficients):
yhat =…

Maagalam HARSHA VARDHAN
- 137
- 2
- 12
1
vote
0 answers
AttributeError: 'int' object has no attribute 'fitness'., Stochastic Universal Sampling --python
I am trying to implement Stochastic Universal Sampling, which works like this:
Let F be the sum of the fitness values of all chromosomes in the population.
Let N be the number of parents to select.
Compute the distance P between successive points:…

User
- 101
- 1
- 9
1
vote
1 answer
Solving SDEs in R with Diffeqr package: possible to set seed?
Is it possible to set a seed (like R's set.seed() function) in the diffeqr package in R, while solving stochastic differential equations?
Example
library(diffeqr)
f <- function(u,p,t) {
return(1.01*u)
}
g <- function(u,p,t) {
return(0.87*u)
}
u0…

user213544
- 2,046
- 3
- 22
- 52
1
vote
1 answer
How do I solve a SDE with two cases in R?
I want to solve the following stochastic differential equation with R:
\frac{dx}{dt}=f(x)+sigma*dW
f(x)= a+bx+cx^2 (for x \leq 1) f(x)= a+bx (for x > 1)
and
sigma=d^2
where (a, b, c, and d are constants).
I tried using:
f =…

Sunny
- 89
- 10
1
vote
0 answers
Approximator of Log likelihood of tanh(mean + std*z)
I have been trying to understand a blog on soft actor critic where we have a neural network representing a policy that outputs mean and std of gaussian distribution of action for a given state. Since direct back-propagation through stochastic node…

user3105965
- 21
- 2
1
vote
1 answer
Understanding Stochastic Hill Climber
I've been trying to understand the stochastic hill climber for a while, but not having any luck with it. I've looked through a book on heuristics and got a pseudo code. I don't understand what the probability function should look like. I understand…

smMavrik
- 13
- 4
1
vote
1 answer
having trouble backtesting based on stochastic
hi i was trying to test if stochastic crosses over 80, buy
if stochastic crosses under 20 sell
for some reason, the order doesn't get executed properly(i mean it doens't get executed at all)
any thoughts on why this is happening?
//@version =…

이종연
- 129
- 1
- 9
1
vote
1 answer
OverflowError as I try to use the value-iteration algorithm with mdptoolbox
I set up a simple MDP for a board that has 4 possible states and 4 possible actions. The board and reward setup looks as follows:
Here S4 is the goal state and S2 is the absorbing state. I have defined the transition probability matrices and reward…

Suhail Gupta
- 22,386
- 64
- 200
- 328