stochastic

Stochastic Differential Equations (SDE) in 2 dimensions

旧时模样 提交于 2020-01-24 10:42:05
问题 I am working on stochastic differential equations for the first time. I am looking to simulate and solve a stochastic differential equations in two dimensions. The model is as follows: dp=F(t,p)dt+G(t,p)dW(t) where: p is a 2-by-1 vector: p=(theta(t); phi(t)) F is a column vector: F=(sin(theta)+Psi* cos(phi); Psi* cot(theta)*sin(phi)) G is a 2-by-2 matrix: G=(D 0;0 D/sin(theta)) Psi is a parameter and D is the diffusion constant I wrote code as follows: function MDL=gyro_2dim(Psi,D) % want to

microsimulation GLM including stochastic part

血红的双手。 提交于 2020-01-03 00:52:28
问题 I'm trying to simulate GLM functions in R including stochastic uncertainty. I compared a formula-based approach to the R-based simulate() function and get different results. Not sure what I (probably its me and not R) am doing wrong. I start by creating a simulation cohort: set.seed(1) library(MASS) d <- mvrnorm(n=3000, mu=c(30,12,60), Sigma=matrix(data=c(45, 5, 40, 5, 15, 13, 40, 13, 300), nrow=3)) d[,1] <- d[,1]^2 Fit the model: m <- glm(formula=d[,1]~d[,2] + d[,3], family=gaussian(link=

Stochastic hill climbing vs first-choice hill climbing algorithms

 ̄綄美尐妖づ 提交于 2019-12-22 13:01:16
问题 What is the difference between stochastic hill climbing and first-choice hill climbing algorithms? 回答1: Hill Climbing Search Algorithm is one of the family of local searches that move based on the better states of its neighbors. Stochastic Hill Climbing chooses a random better state from all better states in the neighbors while first-choice Hill Climbing chooses the first better state from randomly generated neighbors. First-Choice Hill Climbing will become a good strategy if the current

Stochastic hill climbing vs first-choice hill climbing algorithms

半腔热情 提交于 2019-12-22 12:59:18
问题 What is the difference between stochastic hill climbing and first-choice hill climbing algorithms? 回答1: Hill Climbing Search Algorithm is one of the family of local searches that move based on the better states of its neighbors. Stochastic Hill Climbing chooses a random better state from all better states in the neighbors while first-choice Hill Climbing chooses the first better state from randomly generated neighbors. First-Choice Hill Climbing will become a good strategy if the current

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

心不动则不痛 提交于 2019-12-22 04:50:52
问题 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 the issues with numerical stability. Is there a python module for such problems? If not, is there a standard approach for solving such systems. 回答1: There is one: http://diffusion.cgu.edu.tw/ftp/sde/ Example from the site: """ add required Python

What is the significance of the stationary distribution of a markov chain given it's initial state?

て烟熏妆下的殇ゞ 提交于 2019-12-13 07:08:57
问题 Let X_n be a MC, P not regular Say we have a stationary dist (pi_0, ..., pi_n) and P(X_0 = i) = 0.2, does this say anything? To be more clear: I ask because Karlin says when a stationary dist is not a limiting dist, P(X_n = i) is dependent on the initial distribution. What does this exactly mean? 回答1: Your title's question requires a lengthy answer; I'd have to just provide some references for you to read more on Markov chains and ergodic theory. However, your specific question: "...when a

How to add power law likelihood to Netlogo Model

♀尐吖头ヾ 提交于 2019-12-12 21:37:22
问题 I would like to add a likelihood of natural disaster in my environmantal ABM that follows the power law (often few damage, less often mediocre damage, rarely strong damage, very rarely complete damage). I coded so far the following: to environment ;environmental hits create-hits 1 [ ; I do not know if it makes sense to do that? set shape "circle" set color white set size 0.05 setxy random-xcor random-ycor ] ask hits [ ifelse pcolor = red [die] ;if already red, then stop [ ask n-of random

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

故事扮演 提交于 2019-12-10 12:39:59
问题 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. 回答1: There's the statprof module pip install statprof (or easy_install statprof ), then to use: import statprof statprof.start() try: my_questionable_function() finally: statprof.stop() statprof.display() There's a bit of background on the module from this blog post: Why would this matter, though? Python

How to code a slider in Octave to have interactive plot?

烈酒焚心 提交于 2019-12-09 13:51:40
问题 my target is to have a plot that shows Stochastic oscillator on forex market, and in order to validate which parameter is the best one to setup it, I would use a slider to modify it and show updated result on plot. I have my historical data, for a defined pair (let say AUDUSD) and after loading it, I calculate Stocastic oscillator: function [stoch, fk, dk] = stochastic(n, k, d) X=csvread("AUDUSD_2017.csv"); C=X(2:length(X),5); L=X(2:length(X),4); H=X(2:length(X),3); O=X(2:length(X),2); for m