How can I solve an integral problem included of cumulative distribution function of chi-square distribution?
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Louis Liu
 el 17 de Ag. de 2017
  
Excuse me, does anyone know how to solve an integral problem included of cumulative distribution function of chi-square distribution? For example, there is a question like the attached picture:
I want to use the int() function to solve it, however, there are two probability distribution in it, and i don't know how to deal with it.
I hope you can tell me how to solve it like using which function or method instead of giving me the correct answer. Thanks! c = 1.00, n = 100, c = 1.15, Cp = 1.12
2 comentarios
  Torsten
      
      
 el 17 de Ag. de 2017
				https://de.mathworks.com/help/matlab/ref/integral.html
together with
https://de.mathworks.com/help/stats/chi2cdf.html
https://de.mathworks.com/help/stats/normpdf.html
should work.
Best wishes
Torsten.
Respuesta aceptada
  Torsten
      
      
 el 18 de Ag. de 2017
        fun=@(y)chi2cdf((n-1)*(3*Cp*sqrt(n)-y).^2/(9*n*cstar^2),n-1).*(normpdf(y+3*(Cp-C)*sqrt(n))+normpdf(y-3*(Cp-C)*sqrt(n)));
result=integral(fun,0,3*Cp*sqrt(n));
Of course, all the constants have to be given numerical values before calling "integral".
Don't use "syms" anywhere.
Best wishes
Torsten.
6 comentarios
  Torsten
      
      
 el 22 de Ag. de 2017
				
      Editada: Torsten
      
      
 el 22 de Ag. de 2017
  
			Try
C = 1.00;
n = 38;
alpha = 0.05;
Cp = C + 0.33;
fun = @(czero,y)chi2cdf((n-1)*(3*Cp*sqrt(n)-y).^2./(9*n*czero.^2),n-1).*(normpdf(y+3*(Cp-C)*sqrt(n))+normpdf(y-3*(Cp-C)*sqrt(n)));
czero0 = 1.0;
sol = fzero(@(czero)integral(@(y)fun(czero,y)-alpha,0,3*Cp*sqrt(n),'ArrayValued',true),czero0);
Best wishes
Torsten.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

