This repository has been archived on 2021-05-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
scientificComputing/statistics/exercises/mleslope.m
2015-10-25 12:07:04 +01:00

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