Generating correlated data for simulation

조회 수: 2 (최근 30일)
Anushka
Anushka 2023년 4월 12일
답변: Jeff Miller 2023년 4월 13일
I have a set of values in a 1D array of size N. How to generate another array of slightly greater or lesser size with values that are approximately equal? One can assume that the first array was (subjectively) obtained by a person A from some process and the second by person B from the same process; I have to check how closely they agree. Before I move on with the experiment, I wish to fiddle with the possible cases.

답변 (1개)

Jeff Miller
Jeff Miller 2023년 4월 13일
One option is to create the second array by adding a random number to each element of the first array. For example
sigma = 1; % increase or decrease to control the size of Array1/2 differences
Array2 = Array1 + normrnd(size(Array1))*sigma;

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by