stochastic-process

Modify code to get synthetic data that trends smoothly from bull to bear market cycles

a 夏天 提交于 2019-12-02 07:24:16
问题 I have this class that generates synthetic looking (stock) data and it works fine. However, I want to modify it so that NewPrice generates smooth trending data for say n-bars . I know that if I reduce the volatility, I get smoother prices. However, not sure how to guarantee that the data goes into alternating persistant trend either up/down. A sine wave looking thing, but with stock looking prices, i.e, no negative prices. Price = Trend + Previous Price + Random Component I am missing the

Algorithm to find hole in an infinite one dimensional graph

岁酱吖の 提交于 2019-11-29 04:47:28
A cow is standing in front of an infinite fence . On the other side is grass. The cow wants to get to this grass. Somewhere along this fence is a hole through which the cow can get to the other side. The distance d from the cow to the hole has a probability distribution f(d) associated with it i.e. the probability that the hole is k steps away from the cow is given by f(k). Note that we think of all distances as discrete i.e. they are always measured in terms of steps taken by the cow.The cow can take negative integer steps as well as positive integer steps, i.e. k steps to the left and steps

Algorithm to find hole in an infinite one dimensional graph

南楼画角 提交于 2019-11-27 18:38:07
问题 A cow is standing in front of an infinite fence . On the other side is grass. The cow wants to get to this grass. Somewhere along this fence is a hole through which the cow can get to the other side. The distance d from the cow to the hole has a probability distribution f(d) associated with it i.e. the probability that the hole is k steps away from the cow is given by f(k). Note that we think of all distances as discrete i.e. they are always measured in terms of steps taken by the cow.The cow

Generate and plot the empirical joint pdf and CDF [closed]

时光总嘲笑我的痴心妄想 提交于 2019-11-27 01:56:23
Given a pair of two variables (X,Y), how can you generate and plot the empirical joint PDF and CDF in vanilla MATLAB (no toolboxes)? Original answer (Matlab R2015a or lower) The data are: The random variables X, Y: defined as vectors of samples X , Y . The bin edges at the x, y axes: defined by vectors x_axis , y_axis . The edges must obviously be increasing, but need not be uniformly spaced. The resulting PDF and CDF are defined at the centers of the rectangles determined by the x and y edges. To plot the results in 3D, use surf(...) instead of imagesc(...) . clear all %// Data (example): X =