Calculating a log liklihood ratio test based on covariance and mean.

조회 수: 7 (최근 30일)
Niveditha Kumar
Niveditha Kumar 2019년 10월 1일
답변: Shashank Gupta 2019년 10월 4일
I have to test the hypothesis; given
h_0 : Customer belong to bio customers with mean mu_0 and Covarianve sigma_0
h_1 : Customers belong to non bio customers wit mean mu_1 and Covariance sigma_2
I am trying to set up a liklehood ratio test. Please find my code below. I would like to set up a liklihood ratio test and adust threshold to see how it varies. Help on how to procceed with code would be useful.
This is the test that I am trying to set up is as below after simplifying: This is the pearson log liklihood test
clear; clc;
%%
mu = [80 130 200];
L = randn(3);
sigma = L'*L
rng('default') % For reproducibility
R = mvnrnd(mu,sigma,200);
mu1 = [6 110 300];
sigma1 = randn(3);
sigma1 = L'*L
rng('default') % For reproducibility

답변 (1개)

Shashank Gupta
Shashank Gupta 2019년 10월 4일
Hi Niveditha,
There is a function in MATLAB “lratiotest” which will calculate the likelihood ratio test, given the model specification. This function can be used directly in your case since all the required information is provided to you in the hypothesis which is declared.
I hope it helps.
Thanks,

카테고리

Help CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by