Questions tagged [stochastic]

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.

256 questions
19
votes
8 answers

Is there a statistical profiler for python? If not, how could I go about writing one?

I would need to run a python script for some random amount of time, pause it, get a stack traceback, and unpause it. I've googled around for a way to do this, but I see no obvious solution.
shino
  • 4,562
  • 5
  • 38
  • 57
13
votes
3 answers

pine script with two indicators one overlaid on the chart and another on its own?

I am trying to write a pine script with two indicators one overlaid on the chart (EMA) and another on its own?(Stoch) I cannot seem to find any info on how to separate these (Visually) but keep them within 1 pine script, ie to be able to take…
Brandon Saccone
  • 139
  • 1
  • 1
  • 3
10
votes
1 answer

Stochastic gradient descent from gradient descent implementation in R

I have a working implementation of multivariable linear regression using gradient descent in R. I'd like to see if I can use what I have to run a stochastic gradient descent. I'm not sure if this is really inefficient or not. For example, for each…
Daina
  • 421
  • 2
  • 6
  • 13
10
votes
2 answers

Difference between a stochastic and a heuristic algorithm

Extending the question of streetparade, I would like to ask what is the difference, if any, between a stochastic and a heuristic algorithm. Would it be right to say that a stochastic algorithm is actually one type of heuristic?
orestis21
  • 203
  • 1
  • 2
  • 5
10
votes
4 answers

How to perform rank based selection in a genetic algorithm?

I am implementing a small genetic algorithm framework - primarily for private use, unless I manage to make something reasonable at which time I will post it as open source. Right now I am focusing on selection techniques. So far I have implemented…
9
votes
2 answers

R: How to generate a noisy sine function

I am still pretty new to the whole R-thing. I have the following aim; I have a sine function that describes a calcium particle number over time: something like y = a * sin (b*t) + c Since in reality the generation and removal of calcium is described…
Arne
  • 337
  • 1
  • 6
  • 17
9
votes
2 answers

Python Code: Geometric Brownian Motion - what's wrong?

I'm pretty new to Python, but for a paper in University I need to apply some models, using preferably Python. I spent a couple of days with the code I attached, but I can't really help, what's wrong, it's not creating a random process which looks…
Sebastian Schrön
  • 103
  • 1
  • 1
  • 3
7
votes
3 answers

Java implementation of stochastic indicator for finance

Hy, I'm searching for an API/library offering an implementation of the financial stochastic technical analysis. Does someone know a ready-do-use solution? Thanks,
yondaime
  • 101
  • 1
  • 4
7
votes
3 answers

Is there a python module to solve/integrate a system of stochastic differential equations?

I have a system of stochastic differential equations that I would like to solve. I was hoping that this issue was already address. I am a bit concerned about constructing my own solver because I fear my solver would be too slow, and there could be…
CraigF
  • 388
  • 3
  • 8
6
votes
2 answers

What is going on with floating point precision here?

This question is in reference is an observation from a code-golf challenge. The submitted R solution is a working solution, but a few of us (maybe just I) seems to be dumbfounded as to why the initial X=m reassignment is necessary. The code is…
6
votes
1 answer

Generate a random boolean with given probability

I am writing java code to solve a problem with simulated annealing method. I need a method to generate a random true only with probability exp(a/b) where a and b are given parameters. Thanks.
Nina
  • 63
  • 1
  • 4
6
votes
2 answers

Stochastic Hill Climbing

I am trying to implement Stoachastic Hill Climbing in Java. I understand that this algorthim makes a new solution which is picked randomly and then accept the solution based on how bad/good it is. For example, if its very bad then it will have a…
Mikey
  • 687
  • 4
  • 17
6
votes
2 answers

Generate stochastic random deviates from a density object with R

I have a density object dd created like this: x1 <- rnorm(1000) x2 <- rnorm(1000, 3, 2) x <- rbind(x1, x2) dd <- density(x) plot(dd) Which produces this very non-Gaussian distribution: alt text…
JD Long
  • 59,675
  • 58
  • 202
  • 294
5
votes
1 answer

How to improve Brownian motion monte carlo simulation speed?

I want to make my code run faster for more iterations and runs. Right now my code is too slow, but I don't know what to change to speed it up. I began by coding a kinetic Monte Carlo simulation, then editing it to become a Brownian motion…
5
votes
1 answer

efficient sampling from beta-binomial distribution in python

for a stochastic simulation I need to draw a lot of random numbers which are beta binomial distributed. At the moment I implemented it this way (using python): import scipy as scp from scipy.stats import rv_discrete class…
1
2 3
16 17