How to perform MLE calibration on t location scale with boundaries on the parameters?

4 次查看(过去 30 天)
I need to calibrate a t-locationScale distribution over a set of data of historical returns on financial data.
Using mle(), it returns with parameters that are not consistent with my assumptions: I need the degrees of freedom "nu" to be higher or equal to 3.
If I try to use LowerBound, UpperBound or fmincon as additional inputs the function doesn't consider these input without data truncation as reported in the helper (but I don't need to truncate or censor data).
In RStudio is possible to fit this data with these assumptions using fitdist with mle using the method "lbfgs". Is it possible to replicate also in matlab?
Thanks

回答(3 个)

praguna manvi
praguna manvi 2024-8-8
According to the documentation for "mle", it is possible to enforce upper and lower bound constraints on the "nu" variable when a custom pdf is defined. Please refer to the sections of "LowerBound" / "UpperBound" under the "Other Options" link below :
It’s possible to define a pdf for the “tLocationScale” distribution using “tpdf”” which implements student's t-distribution pdf as follows:
custompdf = @(x, mu, sigma, nu) tpdf((x - mu) / sigma, nu) / sigma;
% pass this as an argument with other constraints to mle as follows:
[paramEstimates, paramCIs] = mle(data, 'pdf', custompdf, 'start', start, 'lower', lb, 'upper', ub, 'options', ...
statset('MaxIter', 1e5, 'MaxFunEvals', 1e5));

Srinivas
Srinivas 2024-10-8
% Example data
data = randn(100, 1); % replace with your actual data
% Initial parameter estimates
start = [mean(data), std(data), 5]; % Example: mean, std, degrees of freedom
% Parameter bounds
lb = [-Inf, 0, 1]; % mu can be any value, sigma > 0, nu > 0
ub = [Inf, Inf, Inf]; % no upper limits for mu, sigma, nu
% Custom PDF function
custompdf = @(x, mu, sigma, nu) tpdf((x - mu) / sigma, nu) / sigma;
% MLE estimation
[paramEstimates, paramCIs] = mle(data, 'pdf', custompdf, 'start', start, ...
'lower', lb, 'upper', ub, 'options', statset('MaxIter', 1e5, 'MaxFunEvals', 1e5));
% Display results
disp('Parameter Estimates:');
disp(paramEstimates);
disp('Confidence Intervals:');
disp(paramCIs);
% Example data
data = randn(100, 1); % replace with your actual data
% Initial parameter estimates
start = [mean(data), std(data), 5]; % Example: mean, std, degrees of freedom
% Parameter bounds
lb = [-Inf, 0, 1]; % mu can be any value, sigma > 0, nu > 0
ub = [Inf, Inf, Inf]; % no upper limits for mu, sigma, nu
% Custom PDF function
custompdf = @(x, mu, sigma, nu) tpdf((x - mu) / sigma, nu) / sigma;
% MLE estimation
[paramEstimates, paramCIs] = mle(data, 'pdf', custompdf, 'start', start, ...
'lower', lb, 'upper', ub, 'options', statset('MaxIter', 1e5, 'MaxFunEvals', 1e5));
% Display results
disp('Parameter Estimates:');
disp(paramEstimates);
disp('Confidence Intervals:');
disp(paramCIs);

Srinivas
Srinivas 2024-10-8
% Example data
data = randn(100, 1); % replace with your actual data
% Initial parameter estimates
start = [mean(data), std(data), 5]; % Example: mean, std, degrees of freedom
% Parameter bounds
lb = [-Inf, 0, 1]; % mu can be any value, sigma > 0, nu > 0
ub = [Inf, Inf, Inf]; % no upper limits for mu, sigma, nu
% Custom PDF function
custompdf = @(x, mu, sigma, nu) tpdf((x - mu) / sigma, nu) / sigma;
% MLE estimation
[paramEstimates, paramCIs] = mle(data, 'pdf', custompdf, 'start', start, ...
'lower', lb, 'upper', ub, 'options', statset('MaxIter', 1e5, 'MaxFunEvals', 1e5));
% Display results
disp('Parameter Estimates:');
disp(paramEstimates);
disp('Confidence Intervals:');
disp(paramCIs);

类别

Help CenterFile Exchange 中查找有关 Parameter Estimation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by