Can someone help me write out this equation for chi-square please
1 次查看(过去 30 天)
显示 更早的评论
I am having trouble writing this equation out in matlab, am a beginner. This is my attempt so far: CS= sum(((y-m)./err_y).^2). Any help would be much appreciated!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/385248/image.png)
0 个评论
回答(1 个)
Alan Stevens
2020-10-19
As long as y, m and err_y have the same number of elements then your expression should work ok.
3 个评论
Alan Stevens
2020-10-19
It is reasonable that the better fitting model produces a smaller value of chi-squared.
Your expression for chi-square looks somewhat unusual to me
(see https://www.statisticshowto.com/probability-and-statistics/chi-square/ for example), however, I'm no statistics expert.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!