How to perform MLE calibration on t location scale with boundaries on the parameters?
2 views (last 30 days)
Show older comments
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
0 Comments
Answers (3)
praguna manvi
on 8 Aug 2024
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));
0 Comments
Srinivas
on 8 Oct 2024
% 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);
0 Comments
Srinivas
on 8 Oct 2024
% 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);
0 Comments
See Also
Categories
Find more on Parameter Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!