Filter löschen
Filter löschen

How to calculate the log likelihood of a fit

7 Ansichten (letzte 30 Tage)
Marco Borges
Marco Borges am 24 Jun. 2016
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 );

Antworten (0)

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by