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

7 views (last 30 days)
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

Answers (1)

Shashank Gupta
Shashank Gupta on 4 Oct 2019
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,

Community Treasure Hunt

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

Start Hunting!