c14-2 (Numerical Recipes in C)

PDF-файл c14-2 (Numerical Recipes in C) Цифровая обработка сигналов (ЦОС) (15352): Книга - 8 семестрc14-2 (Numerical Recipes in C) - PDF (15352) - СтудИзба2017-12-27СтудИзба

Описание файла

Файл "c14-2" внутри архива находится в папке "Numerical Recipes in C". PDF-файл из архива "Numerical Recipes in C", который расположен в категории "". Всё это находится в предмете "цифровая обработка сигналов (цос)" из 8 семестр, которые можно найти в файловом архиве МГТУ им. Н.Э.Баумана. Не смотря на прямую связь этого архива с МГТУ им. Н.Э.Баумана, его также можно найти и в других разделах. Архив можно найти в разделе "книги и методические указания", в предмете "цифровая обработка сигналов" в общих файлах.

Просмотр PDF-файла онлайн

Текст из PDF

14.2 Do Two Distributions Have the Same Means or Variances?615CITED REFERENCES AND FURTHER READING:Bevington, P.R. 1969, Data Reduction and Error Analysis for the Physical Sciences (New York:McGraw-Hill), Chapter 2.Stuart, A., and Ord, J.K. 1987, Kendall’s Advanced Theory of Statistics, 5th ed. (London: Griffinand Co.) [previous eds. published as Kendall, M., and Stuart, A., The Advanced Theoryof Statistics], vol. 1, §10.15Norusis, M.J. 1982, SPSS Introductory Guide: Basic Statistics and Operations; and 1985, SPSSX Advanced Statistics Guide (New York: McGraw-Hill).Chan, T.F., Golub, G.H., and LeVeque, R.J. 1983, American Statistician, vol.

37, pp. 242–247. [1]Cramér, H. 1946, Mathematical Methods of Statistics (Princeton: Princeton University Press),§15.10. [2]14.2 Do Two Distributions Have the SameMeans or Variances?Not uncommonly we want to know whether two distributions have the samemean. For example, a first set of measured values may have been gathered beforesome event, a second set after it. We want to know whether the event, a “treatment”or a “change in a control parameter,” made a difference.Our first thought is to ask “how many standard deviations” one sample mean isfrom the other.

That number may in fact be a useful thing to know. It does relate tothe strength or “importance” of a difference of means if that difference is genuine.However, by itself, it says nothing about whether the difference is genuine, that is,statistically significant.

A difference of means can be very small compared to thestandard deviation, and yet very significant, if the number of data points is large.Conversely, a difference may be moderately large but not significant, if the dataare sparse. We will be meeting these distinct concepts of strength and significanceseveral times in the next few sections.A quantity that measures the significance of a difference of means is not thenumber of standard deviations that they are apart, but the number of so-calledstandard errors that they are apart.

The standard error of a set of values measuresthe accuracy with which the sample mean estimates the population (or “true”) mean.Typically the standard error is equal to the sample’s standard deviation divided bythe square root of the number of points in the sample.Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.

Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).that this is wasteful, since it yields much more information than just the median(e.g., the upper and lower quartile points, the deciles, etc.). In fact, we saw in§8.5 that the element x(N+1)/2 can be located in of order N operations. Consultthat section for routines.The mode of a probability distribution function p(x) is the value of x where ittakes on a maximum value.

The mode is useful primarily when there is a single, sharpmaximum, in which case it estimates the central value. Occasionally, a distributionwill be bimodal, with two relative maxima; then one may wish to know the twomodes individually. Note that, in such cases, the mean and median are not veryuseful, since they will give only a “compromise” value between the two peaks.616Chapter 14.Statistical Description of DataStudent’s t-test for Significantly Different MeanssPsD =i∈A (xiP− xA)2 + i∈B (xi − xB )211+NA + NB − 2NANB(14.2.1)where each sum is over the points in one sample, the first or second, each meanlikewise refers to one sample or the other, and NA and NB are the numbers of pointsin the first and second samples, respectively.

Second, compute t byt=xA − xBsD(14.2.2)Third, evaluate the significance of this value of t for Student’s distribution withNA + NB − 2 degrees of freedom, by equations (6.4.7) and (6.4.9), and by theroutine betai (incomplete beta function) of §6.4.The significance is a number between zero and one, and is the probability that|t| could be this large or larger just by chance, for distributions with equal means.Therefore, a small numerical value of the significance (0.05 or 0.01) means that theobserved difference is “very significant.” The function A(t|ν) in equation (6.4.7)is one minus the significance.As a routine, we have#include <math.h>void ttest(float data1[], unsigned long n1, float data2[], unsigned long n2,float *t, float *prob)Given the arrays data1[1..n1] and data2[1..n2], this routine returns Student’s t as t,and its significance as prob, small values of prob indicating that the arrays have significantlydifferent means.

The data arrays are assumed to be drawn from populations with the sametrue variance.{void avevar(float data[], unsigned long n, float *ave, float *var);float betai(float a, float b, float x);float var1,var2,svar,df,ave1,ave2;avevar(data1,n1,&ave1,&var1);avevar(data2,n2,&ave2,&var2);df=n1+n2-2;svar=((n1-1)*var1+(n2-1)*var2)/df;*t=(ave1-ave2)/sqrt(svar*(1.0/n1+1.0/n2));*prob=betai(0.5*df,0.5,df/(df+(*t)*(*t)));Degrees of freedom.Pooled variance.See equation (6.4.9).}which makes use of the following routine for computing the mean and varianceof a set of numbers,Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.

Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).Applying the concept of standard error, the conventional statistic for measuringthe significance of a difference of means is termed Student’s t. When the twodistributions are thought to have the same variance, but possibly different means,then Student’s t is computed as follows: First, estimate the standard error of thedifference of the means, sD , from the “pooled variance” by the formula14.2 Do Two Distributions Have the Same Means or Variances?617void avevar(float data[], unsigned long n, float *ave, float *var)Given array data[1..n], returns its mean as ave and its variance as var.{unsigned long j;float s,ep;}The next case to consider is where the two distributions have significantlydifferent variances, but we nevertheless want to know if their means are the same ordifferent.

(A treatment for baldness has caused some patients to lose all their hairand turned others into werewolves, but we want to know if it helps cure baldness onthe average!) Be suspicious of the unequal-variance t-test: If two distributions havevery different variances, then they may also be substantially different in shape; inthat case, the difference of the means may not be a particularly useful thing to know.To find out whether the two data sets have variances that are significantlydifferent, you use the F-test, described later on in this section.The relevant statistic for the unequal variance t-test ist=xA − xB[Var(xA )/NA + Var(xB )/NB ]1/2(14.2.3)This statistic is distributed approximately as Student’s t with a number of degreesof freedom equal toVar(xA ) Var(xB )+NANB22[Var(xA )/NA][Var(xB )/NB ]+NA − 1NB − 12(14.2.4)Expression (14.2.4) is in general not an integer, but equation (6.4.7) doesn’t care.The routine is#include <math.h>#include "nrutil.h"void tutest(float data1[], unsigned long n1, float data2[], unsigned long n2,float *t, float *prob)Given the arrays data1[1..n1] and data2[1..n2], this routine returns Student’s t as t, andits significance as prob, small values of prob indicating that the arrays have significantly different means.

The data arrays are allowed to be drawn from populations with unequal variances.{void avevar(float data[], unsigned long n, float *ave, float *var);float betai(float a, float b, float x);float var1,var2,df,ave1,ave2;Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.

Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).for (*ave=0.0,j=1;j<=n;j++) *ave += data[j];*ave /= n;*var=ep=0.0;for (j=1;j<=n;j++) {s=data[j]-(*ave);ep += s;*var += s*s;}*var=(*var-ep*ep/n)/(n-1);Corrected two-pass formula (14.1.8).618Chapter 14.Statistical Description of Dataavevar(data1,n1,&ave1,&var1);avevar(data2,n2,&ave2,&var2);*t=(ave1-ave2)/sqrt(var1/n1+var2/n2);df=SQR(var1/n1+var2/n2)/(SQR(var1/n1)/(n1-1)+SQR(var2/n2)/(n2-1));*prob=betai(0.5*df,0.5,df/(df+SQR(*t)));}1 X(xAi − xA )(xBi − xB )N −1i=11/2Var(xA ) + Var(xB ) − 2Cov(xA , xB )=NNCov(xA , xB ) ≡sDt=xA − xBsD(14.2.5)(14.2.6)(14.2.7)where N is the number in each sample (number of pairs).

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Нашёл ошибку?
Или хочешь предложить что-то улучшить на этой странице? Напиши об этом и получи бонус!
Бонус рассчитывается индивидуально в каждом случае и может быть в виде баллов или бесплатной услуги от студизбы.
Предложить исправление
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
5140
Авторов
на СтудИзбе
441
Средний доход
с одного платного файла
Обучение Подробнее