How to calculate the log likelihood of a fit

7 次查看(过去 30 天)
I wonder how to calculate the log likelihood value given a general fit on Matlab, for example: what is the log likelihood of the fit results of this data?
xData = linspace(1,10,1000)';
yData = xData + randn(1000,1);
%%Fit: 'Linear'
% Set up fittype and options.
ft = fittype( 'T0+T1*D', 'independent', 'D', 'dependent', 'T' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.Robust = 'Bisquare';
opts.StartPoint = [0.568823660872193 0.469390641058206];
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by