Create a logarithmic Latin Hypercube Sampling distribution (with lhsdesign).
显示 更早的评论
Hi,
i want to get a logarithmic sample distribution with lhsdesign and fix boundaries. Heres my code:
num_samples = 40; % number of samples
num_parameters = 2; % number of parameters
variableBounds = [1e-14 1e-12; 1e-14 1e-12]; % defines the boundaries
lhsMatrix = lhsdesign(num_samples, num_parameters);
% Scale the LHS samples to the desired parameter ranges
params = zeros(num_samples, num_parameters);
for j = 1:num_parameters
params(:, j) = lhsMatrix(:, j) * (variableBounds(j, 2) - variableBounds(j, 1)) + variableBounds(j, 1);
end
scatter(params(:,1), params(:,2),'filled', 'MarkerFaceAlpha',0.3, 'SizeData',90,'MarkerFaceColor', 'blue');
xlabel('$Parameter 1$', 'Interpreter', 'latex');
ylabel('$Parameter 2$', 'Interpreter', 'latex');
title('Sample distribution');
% set(gca, 'XScale', 'log');
% set(gca, 'YScale', 'log');
grid on
If i create the lhsMatrix with lhsdesign, the samples will get distributed perfectly with no log axes.
What i desire is a proper sample distribution with log axes.
num_samples = 40; % number of samples
num_parameters = 2; % number of parameters
variableBounds = [1e-14 1e-12; 1e-14 1e-12]; % defines the boundaries
lhsMatrix = lhsdesign(num_samples, num_parameters);
% Scale the LHS samples to the desired parameter ranges
params = zeros(num_samples, num_parameters);
for j = 1:num_parameters
params(:, j) = lhsMatrix(:, j) * (variableBounds(j, 2) - variableBounds(j, 1)) + variableBounds(j, 1);
end
scatter(params(:,1), params(:,2),'filled', 'MarkerFaceAlpha',0.3, 'SizeData',90,'MarkerFaceColor', 'blue');
xlabel('$Parameter 1$', 'Interpreter', 'latex');
ylabel('$Parameter 2$', 'Interpreter', 'latex');
title('Sample distribution');
set(gca, 'XScale', 'log');
set(gca, 'YScale', 'log');
grid on
As you can see the distribution with log axes is really bad. So i need to create a lhsMatrix with log values to get a proper distribution on my log scales. Can someone help me out with this problem?
Thanks in advance :)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Queue, Service, and Route Modeling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

