Sequence promotion statistically in MATLAB

Are there any built-in functions in MATLAB that will statistically expand the sequence of real numbers so that the resulting sequence is expanded to whatever size I want. I have a sequence of 499 elements, and I want to expand it to 4096 elements. Thanks in advance.

+3
source share
3 answers

If you want to interpolate a vector of 499 elements to a higher resolution of 4096 elements, you can use INTERP1 (as follows: x- your vector with 499 elements):

y = interp1(x,linspace(1,499,4096));

LINSPACE 4096 , 1 499, . INTERP1 . :

y = interp1(x,linspace(1,499,4096),'spline');  %# Cubic spline method
y = interp1(x,linspace(1,499,4096),'pchip');   %# Piecewise cubic Hermite method
+2

"" , , ( ) . interp1q interp1.

+1

Pearson Johnson , pearsrnd johnsrnd ( , )

:

%# load data, lets say this is vector of 499 elements
data = load('data.dat');

%# generate more data using pearsrnd
moments = {mean(data),std(data),skewness(data),kurtosis(data)};
newData = pearsrnd(moments{:}, [4096-499 1]);

%# concat sequences
extendedData = [data; newData];

%# plot histograms (you may need to adjust the num of bins to see the similarity)
subplot(121), hist(data), xlabel('x'), ylabel('Frequency')
subplot(122), hist(extendedData), xlabel('x'), ylabel('Frequency')

johnsrnd:

%# generate more data using johnsrnd
quantiles = quantile(data, normcdf([-1.5 -0.5 0.5 1.5]));
newData = johnsrnd(quantiles, [4096-499 1]);


, , ecdf ksdensity. , ( !).

+1

Source: https://habr.com/ru/post/1726512/


All Articles