필터 지우기
필터 지우기

Generate a multiplicative cascade process

조회 수: 4 (최근 30일)
Tchilabalo
Tchilabalo 2019년 5월 31일
댓글: darova 2019년 6월 3일
I am trying to simulate a multiplicative cascade process. At the first iteration i call four random numbers (between 0 and 1); these numbers are the initial probabilities. In the following step, i call again four random numbers and then multiply them by the parent probabilities as shown in the figure. I repeat the process 6 times. At each iteration, i want the four probabilities (x, y, z, and w) to satisfy the following conditions:
(1) x^2+y^2+z^2+w^2== m, where m is a constant
(2) x+y+z+w==1
I have tried to use the "solve" and "vapsolve" tools in matlab, but the problem is that i am getting negative numbers and zero values. I have also tried to set x and y so that i only have two unknowns, but it didn't help.
I will appreciate any help.

채택된 답변

darova
darova 2019년 5월 31일
Probably should think about initial m, w, z
m = 0.2;
z = rand;
w = rand;
syms x
y = -x-z-w+1;
eq = x^2+y^2+z^2+w^2 -m;
X = solve(eq,x);
x = double(X)
Y = matlabFunction(y);
Y(x)
  댓글 수: 6
Tchilabalo
Tchilabalo 2019년 6월 1일
Thanks very much for your help. It is working now.
darova
darova 2019년 6월 3일
I made a mistake before
Z2(imag(Z2)~=0) = inf; % remove complex numbers
% should be
Z2(imag(Z2)~=0) = NaN; % remove complex numbers

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by