拉普拉斯分布只有一个位置和一个尺度参数。位置参数就是中位数,尺度参数就是每个点到中位数的平均距离。
function [mu, b] = estimate_laplace_params(data)
% 估计位置参数 μ(中位数)
mu = median(data);
% 估计尺度参数 b
b = mean(abs(data - mu));
end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!