This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/likelihood/exercises/mleslope.m

7 lines
204 B
Matlab

function slope = mleslope(x, y )
% Compute the maximum likelihood estimate of the slope
% of a line through the origin
% given the data pairs in the vectors x and y.
slope = sum(x.*y)/sum(x.*x);
end