필터 지우기
필터 지우기

How to calculate the log likelihood of a fit

조회 수: 7 (최근 30일)
Marco Borges
Marco Borges 2016년 6월 24일
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