| ²é¿´: 2730 | »Ø¸´: 3 | ||
dingjh1992гæ (СÓÐÃûÆø)
|
[ÇóÖú]
ÇóÖú£¬matlabÖеĿ¨·½¼ìÑéÔõôŪ ÒÑÓÐ2È˲ÎÓë
|
|
ÔÚhelpÖÐÊäÈëchi2testÈ»ºó²é²»µ½¡£¡£ÍøÉÏ˵ÊÇÓÃÕâ¸öÖ¸Áî ·¢×ÔСľ³æAndroid¿Í»§¶Ë |
» ²ÂÄãϲ»¶
Сľ³æÃ»ÂäÁË£¬³ýÁËÆíµ»Ìû×Ó£¬¼¸ºõ¿´²»µ½ÓмÛÖµµÄÌû×Ó
ÒѾÓÐ15È˻ظ´
ÃæÉϵÄË®ºÜÉî
ÒѾÓÐ18È˻ظ´
¹úÉç¿ÆÍ¨Ñ¶ÆÀÉó
ÒѾÓÐ5È˻ظ´
5¸ö%2F£¬·Ç¹Ì¶¨¶Î22¸ö×Öĸ
ÒѾÓÐ9È˻ظ´
ÉúÃü¿ÚC13ÃæÉÏ»áÆÀʱ¼ä
ÒѾÓÐ11È˻ظ´
ÄÚÐÄØÑ·¦
ÒѾÓÐ16È˻ظ´
ÉúÃü¿ÚÃæÉÏ»áÆÀ½áÊøÁËÂð´ó¼ÒÓÐÖªµÀ½á¹ûÂð£¿ÏÖÔÚ»¹Ã»Óнá¹ûÕý³£²»£¿
ÒѾÓÐ9È˻ظ´
ͶӢÎÄÆÚ¿¯ÈçºÎ²éÖØ
ÒѾÓÐ6È˻ظ´
²»ÒªÔÙÊý¹ú×ÔÈ»ÉêÇëÊéµÄ filecode µÄ·Ö¸ô·û¸öÊýÁË
ÒѾÓÐ21È˻ظ´
²®°·Éϼ׻ùÇóÖú
ÒѾÓÐ7È˻ظ´
» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:
ÇóÖú£¬MATLABÖÐÈçºÎ·ÃÎÊCOMSOLÖÐij¸öʵÌåµÄÌå»ý£¿
ÒѾÓÐ1È˻ظ´
ºô½Ð°æÖ÷£¬ÔÚÏß½ô¼±ÇóÖú£¬¹ØÓÚmatlabÖÐ΢·Ö·½³Ì×é²ÎÊýÄâºÏµÃÎÊÌ⣡
ÒѾÓÐ12È˻ظ´
ÇóÖú£¬matlabÔËÐкóÌáʾÓï¾ä²»ÕýÈ·¡£¡£¾ßÌå¼ûÄÚ
ÒѾÓÐ2È˻ظ´
ÇóÖú£¬matlab/ 1stOpt ×Ô¶¨Òå΢·Ö·½³ÌÄâºÏʵÑéÊý¾ÝÀ´Çó·½³ÌÖеIJÎÊý
ÒѾÓÐ9È˻ظ´
ÇóÖú£¬MatlabÇó½â¾ØÕó·½³Ì
ÒѾÓÐ0È˻ظ´
ÇóÖú£¬matlab/ 1stOpt ×Ô¶¨Òå΢·Ö·½³ÌÄâºÏʵÑéÊý¾ÝÀ´Çó·½³ÌÖеIJÎÊý
ÒѾÓÐ1È˻ظ´
ÇóÖú£¬matlab/ 1stOpt ×Ô¶¨Òå΢·Ö·½³ÌÄâºÏʵÑéÊý¾ÝÀ´Çó·½³ÌÖеIJÎÊý
ÒѾÓÐ4È˻ظ´
ÇóÖú£¬matlab×Ô¶¨Òå΢·Ö·½³ÌÄâºÏʵÑéÊý¾ÝÀ´Çó·½³ÌÖеIJÎÊý
ÒѾÓÐ4È˻ظ´
ÇóÖú£¬ÓÃmatlab½â΢·Ö·½³Ì×飬ϣÍû¸ßÊÖÄܸøÓèÖ¸µã
ÒѾÓÐ17È˻ظ´
½ô¼±ÇóÖú£¬matlabÖÐÊäÈëÑÓ³ÙµÈÀàËÆµÄÑÓ³ÙÊÇʲôÒâ˼£¿
ÒѾÓÐ1È˻ظ´
ÇóÖú´ó³æ£¬matlabÖзÂÕæÎÊÌâÉèÖÃÁ˱äÁ¿£¬¿É¸Ä±ä±äÁ¿ÊÇÃ²ËÆ±äÁ¿µþ¼ÓÁËÇó½â
ÒѾÓÐ6È˻ظ´
ÇóÖú´ó³æ£¬matlabÖÐÓÃifÓï¾äÉèÖñäÁ¿³õÖµ
ÒѾÓÐ8È˻ظ´
ÇóÖú£¬MIMOϵͳ×öÐŵÀ¹À¼ÆÊ±£¬MATLAB±à³ÌÉè¼Æ³õʼHµÄ·½·¨£¿
ÒѾÓÐ0È˻ظ´
гæÇóÖú£¬matlabʹÓÃodeÇó½âÄ£ÐÍÎÊÌâ
ÒѾÓÐ0È˻ظ´
½ô¼±ÇóÖú£¬¹ØÓÚmatlab µÄ¼¸¸öÎÊÌâ
ÒѾÓÐ7È˻ظ´
ocnzhao
ľ³æ (ÕýʽдÊÖ)
ÓÎÏ·
- Ó¦Öú: 59 (³õÖÐÉú)
- ½ð±Ò: 4129
- ºì»¨: 7
- Ìû×Ó: 399
- ÔÚÏß: 1039.2Сʱ
- ³æºÅ: 480968
- ×¢²á: 2007-12-17
- רҵ: ¿ØÖÆÀíÂÛÓë·½·¨
¡¾´ð°¸¡¿Ó¦Öú»ØÌû
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
|
function [p, Q]= chi2test(x) % Usage: [p, Q]= chi2test(x) % % The chi-squared test. % % Given a number of samples this function tests the hypothesis that the samples are % independent. If Q > chi2(p, nu), the hypothesis is rejected. % % Each column represents a variables, each row a sample. % % If you find any errors, please let me know: . % % ARGUMENTS: % x Absolut numbers. % p The prob ability value, calculated from Q. % Q The resulting Q-value. % % EXAMPLE 1 % In region A, 324 of 556 cows were red, whereas in region B 98 of 260 were red. % [p, Q]= chi2test([324, 556-324; 98, 260-98]) % p= % 4.2073e-08 % Q= % 30.0515 % With an error risk of about 4e-08, we can claim that the samples are independent. % % EXAMPLE 2 % Throw two different dices to see if they have the same probability of 1 (and 2, 3, 4, 5, 6). % We don't check if they are symetrical, only if the both behave in the same way. % [p,Q] = chi2test([15,10; 7,11; 9,7; 20,15; 26,21; 19,16]) % p= % 0.8200 % Q = % 2.2059 % The dices don't significantly behave differently. That is, they seem to behave in the same way. % % HISTORY: v.1.0, first working version, 2007-08-30. % % COPYRIGHT: (c) 2007 Peder Axensten. Use at own risk. % KEYWORDS: chi-squared test, chi-squared, chi2, test %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Check the arguments. if(nargin ~= 1), error('One and only one argument required!'); end if(ndims(x) ~= 2), error('The argument (x) must be a 2d matrix!'); end if(any(size(x) == 1)), error('The argument (x) must be a 2d matrix!'); end if(any(~isreal(x))), error('All values of the argument (x) must be real values!'); end % Calculate Q = sum( (a-np*)^2/(np*(1-p*)) ) s= size(x, 1); r= size(x, 2); np= sum(x, 2)/sum(sum(x)) * sum(x); % p=sum(x, 2)/sum(sum(x)) and n=sum(x) Q= sum(sum((x-np).^2./(np))); % Calculate cdf of chi-squared to Q. Degrees of freedom, v, is (r-1)*(s-1). p= 1 - gammainc(Q/2, (r-1)*(s-1)/2); end |

2Â¥2016-09-17 10:37:05
ocnzhao
ľ³æ (ÕýʽдÊÖ)
ÓÎÏ·
- Ó¦Öú: 59 (³õÖÐÉú)
- ½ð±Ò: 4129
- ºì»¨: 7
- Ìû×Ó: 399
- ÔÚÏß: 1039.2Сʱ
- ³æºÅ: 480968
- ×¢²á: 2007-12-17
- רҵ: ¿ØÖÆÀíÂÛÓë·½·¨

3Â¥2016-09-17 10:37:38
FMStation
ÖÁ×ðľ³æ (ÖªÃû×÷¼Ò)
- Ó¦Öú: 591 (²©Ê¿)
- ¹ó±ö: 0.03
- ½ð±Ò: 18701.7
- ºì»¨: 97
- Ìû×Ó: 8891
- ÔÚÏß: 1493.2Сʱ
- ³æºÅ: 2400059
- ×¢²á: 2013-04-04
- רҵ: ¼ÆËã»úÓ¦Óü¼Êõ
¡¾´ð°¸¡¿Ó¦Öú»ØÌû
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
|
https://www.mathworks.com/help/stats/chi2gof.html chi2gof Chi-square goodness-of-fit test |
4Â¥2016-09-17 23:11:32











»Ø¸´´ËÂ¥
10