text:
# Low Latency¶

These tables show what performance you can expect from USB 3.2 Gen 1 (5 Gbps) connection with an OAK camera. XLink chunking was disabled for these tests (pipeline.setXLinkChunkSize(0)). For an example code, see Latency measurement.

What

Resolution

FPS

FPS set

Time-to-Host [ms]

Bandwidth

Histogram

Color (isp)

1080P

60

60

33

1.5 Gbps

Color (isp)

4K

28.5

30

150

2.8 Gbps

Mono

720P/800P

120

120

24.5

442/482 Mbps

Mono

400P

120

120

7.5

246 Mbps

• Time-to-Host is measured time between frame timestamp (imgFrame.getTimestamp()) and host timestamp when the frame is received (dai.Clock.now()).

• Histogram shows how much Time-to-Host varies frame to frame. Y axis represents number of frame that occurred at that time while the X axis represents microseconds.

• Bandwidth is calculated bandwidth required to stream specified frames at specified FPS.

## Encoded frames¶

What

Resolution

FPS

FPS set

Time-to-Host [ms]

Histogram

Color video H.265

4K

28.5

30

210

Color video MJPEG

4K

30

30

71

Color video H.265

1080P

60

60

42

Color video MJPEG

1080P

60

60

31

Mono H.265

800P

60

60

23.5

Mono MJPEG

800P

60

60

22.5

Mono H.265

400P

120

120

7.5

Mono MJPEG

400P

120

120

7.5

You can also reduce frame latency by using Zero-Copy branch of the DepthAI. This will pass pointers (at XLink level) to cv2.Mat instead of doing memcopy (as it currently does), so performance improvement would depend on the image sizes you are using. (Note: API differs and not all functionality is available as is on the message_zero_copy branch)

## PoE latency¶

On PoE, the latency can vary quite a bit due to a number of factors:

• Network itself. Eg. if you are in a large network with many nodes, the latency will be higher compared to using a direct connection.

• There’s a bottleneck in bandwidth:

• Perhaps some network link is 10mbps/100mbps instead of full 1gbps (due to switch/network card..). You can test this with PoE Test script (speed should be 1000).

• Network/computer is saturated with other traffic. You can test the actual bandwidth with OAK bandwidth test script. With direct link I got ~800mbps downlink and ~210mbps uplink.

• Computer’s Network Interface Card settings, documentation here

• 100% OAK Leon CSS (CPU) usage. The Leon CSS core handles the POE communication (see docs here), and if the CPU is 100% used, it will not be able to handle the communication as fast as it should.

• Another potential way to improve PoE latency would be to fine-tune network settings, like MTU, TCP window size, etc. (see here for more info)

## Bandwidth¶

With large, unencoded frames, one can quickly saturate the bandwidth even at 30FPS, especially on PoE devices (1gbps link):

The third value in the formula is byte/pixel, which is 1.5 for NV12/YUV420, 3 for RGB, and 2 for depth frames, and 1 for mono (grayscale) frames. It’s either 1 (normal) or 2 (subpixel mode) for disparity frames.

A few options to reduce bandwidth:

• Encode frames (H.264, H.265, MJPEG) on-device using VideoEncoder node

• Reduce FPS/resolution/number of streams

## Reducing latency when running NN¶

In the examples above we were only streaming frames, without doing anything else on the OAK camera. This section will focus on how to reduce latency when also running NN model on the OAK.

### 1. Increasing NN resources¶

One option to reduce latency is to increase the NN resources. This can be done by changing the number of allocated NCEs and SHAVES (see HW accelerator docs here). Compile Tool can compile a model for more SHAVE cores. To allocate more NCEs, you can use API below:

import depthai as dai

pipeline = dai.Pipeline()
# nn = pipeline.createNeuralNetwork()
# nn = pipeline.create(dai.node.MobileNetDetectionNetwork)
nn = pipeline.create(dai.node.YoloDetectionNetwork)
nn.setNumInferenceThreads(1) # By default 2 threads are used
nn.setNumNCEPerInferenceThread(2) # By default, 1 NCE is used per thread

Models usually run at max FPS when using 2 threads (1 NCE/Thread), and compiling model for AVAILABLE_SHAVES / 2.

Example of FPS & latency comparison for YoloV7-tiny:

NN resources

Camera FPS

Latency

NN FPS

15

155 ms

15

14

149 ms

14

13

146 ms

13

10

141 ms

10

30

145 ms

11.6

12

128 ms

12

10

118 ms

10

### 2. Lowering camera FPS to match NN FPS¶

Lowering FPS to not exceed NN capabilities typically provides the best latency performance, since the NN is able to start the inference as soon as a new frame is available.

For example, with 15 FPS we get a total of about 70 ms latency, measured from capture time (end of exposure and MIPI readout start).

This time includes the following:

• ISP processing

• Preview post-processing

• NN processing

• Streaming to host

• And finally, eventual extra latency until it reaches the app

Note: if the FPS is increased slightly more, towards 19..21 FPS, an extra latency of about 10ms appears, that we believe is related to firmware. We are actively looking for improvements for lower latencies.

### 3. NN input queue size and blocking behavior¶

If the app has detNetwork.input.setBlocking(False), but the queue size doesn’t change, the following adjustment may help improve latency performance:

By adding detNetwork.input.setQueueSize(1), while setting back the camera FPS to 40, we get about 80.. 105ms latency. One of the causes of being non-deterministic is that the camera is producing at a different rate (25ms frame-time), vs. when NN has finished and can accept a new frame to process.

## Got questions?

We’re always happy to help with code or other questions you might have.


text:
# Math Help - Transcendental

1. ## Transcendental

Assuming the pi is transcendental over Q, prove that (pi)^2 is also transcendental over Q

2. Originally Posted by Coda202
Assuming the pi is transcendental over Q, prove that (pi)^2 is also transcendental over Q
If $\pi^2$ was a root of the rational polynomial $P(x)$, then $\pi$ would be a root of $P(x^2)$.

format: plain


text:
# Statistics question

#### Andrey Ivanov

##### New Member
Can someone help with these questions:

4. In a survey, some of the questions concern sensitive issues (e.g., income, drug use, sexual experiences). As a result, some respondents do not answer the questions truthfully. Denote the proportion of the members of a particular population that had incomes over $100,000 last year by p. A random sample of n members of this population is taken, and each person in the sample is asked “Was your income over$100,000 last year?” If a person really had an income over $100,000, the probability that she will give a truthful answer to this question is 1-1. If a person’s income was not over$100,000, the probability that she will give a truthful answer is 1-2. From past experience, 1 and 2 are known, with 0<1<0.5, 0<2<0.5.
a) For a sample of size one, find the likelihood function if the answer is “yes” and find the likelihood function if the answer is “no.”
b) For a random sample of size n, find the likelihood function and sufficient statistics.
c) Find the maximum likelihood estimator for p.
d) Assume that 1=0.1, 2=0, and there is one “yes” answer in a random sample of size 10. What is your best estimate of p and why?
e) Consider the same scenario as in (d), but assume that 1 is unknown (0<1<1). In this case, what would be your best estimate of p and why?

6. A journal editor says: “If we only publish papers with results that are statistically significant at the =0.05 level, at most 5% of our papers will have erroneous results.” Denote by p the proportion of researchers with true H0 and false H1. Suppose that each researcher performs one test, sends the paper to the journal, and the paper is accepted if the results of the test are significant at the =0.05 level.
a) If in a given year the journal publishes n papers, find the distribution of the papers with erroneous results that are published in this year. Assume that all the tests in all papers have the same , probability of type II error.
b) What is this distribution if p=1, i.e., if all researchers, submitting the papers this year, had true H0 and false H1?
c) Overall, comment on the above statement of a journal editor.


text:
# Comma operator in C/C++

C++Server Side ProgrammingProgramming

The purpose of comma operator is to string together several expressions. The value of a commaseparated list of expressions is the value of the right-most expression. Essentially, the comma's effect is to cause a sequence of operations to be performed.

The values of the other expressions will be discarded. This means that the expression on the right side will become the value of the entire comma-separated expression. For example

var = (count = 19, incr = 10, count+1);

Here first assigns count the value 19, assigns incr the value 10, then adds 1 to count, and finally, assigns var the value of the rightmost expression, count+1, which is 20. The parentheses are necessary because the comma operator has a lower precedence than the assignment operator.

To see the effects of the comma operator, try running the following program.

## Example Code

#include <iostream>
using namespace std;
int main() {
int i, j;
j = 10;
i = (j++, j+100, 999+j);
cout << i;
return 0;
}

## Output

1010

Here is the procedure how the value of i gets calculated: j starts with the value 10. j is then incremented to 11. Next, j is added to 100. Finally, j (still containing 11) is added to 999, which yields the result 1010.

Published on 14-Mar-2019 15:58:15
Advertisements


text:
• Subject:

...

• Topic:

...

In an ac circuit the reactance of a coil is $\sqrt{3}$ times its resistance, the phase difference between the voltage across the coil to the current through the coil will be

(1) π/3

(2) π/2

(3) π/4

(4) π/6


text:
# Revision Questions - Help!

• November 16th 2011, 01:37 PM
Revision Questions - Help!
Hi, I am doing some revision questions to keep up with some course work, and I am afraid that the course is starting to get away from me slightly.

I would be very much obliged if someone would be kind enough to give me a brief explanation about the following questions...

1. Suppose the output of a firm is given by Y = KL where K denotes the number of units of capital, L denotes the number of units of labour, and Y denotes the number of units of output
What is the first derivative of Y with respect to K?
Zero
None of these
L
K
KL

I think the answer is 1 (i.e. none of these) as the units are to the power of 1, but am not sure.
Question 2

1. Suppose the output of a firm is given by Y = KL where K denotes the number of units of capital, L denotes the number of units of labour, and Y denotes the number of units of output
What is the second derivative of Y with respect to K? How would you interpret this?

Second derivative of Y with respect to K is KL.
This means that the marginal product of output with respect to capital increases as capital increases.

Second derivative of Y with respect to K is K.
This means that the marginal product of output with respect to capital increases as capital increases.

Second derivative of Y with respect to K is L.
This means that the marginal product of output with respect to capital increases as capital increases.

Second derivative of Y with respect to K is 0.
This means that the marginal product of output with respect to capital does not vary as capital increases.

Based on my previous answer, I have to go with none, but doubting I understand this part either...

Uggggh, exams coming up soon, and to be honest, on this part of the course, I am clueless, would really really appreciate some help. :(

Thanks so much. (Headbang)

(Crying)
• November 16th 2011, 03:05 PM
emakarov
Re: Revision Questions - Help!
You need to know how to find derivatives of basic functions. In particular, if $c$ is a constant, then $(cx)'=\frac{d(cx)}{dx}=c$ and $c'=\frac{dc}{dx}=0$.

When a function has two or more variables and you take a partial derivative with respect to one of them, the other variables are considered constant. For example, $\frac{\partial (xy)}{\partial x}=y$ and $\frac{\partial y}{\partial x}=0$. Since the derivative is taken with respect to $x$, the variable $y$ is considered to be a constant.

A joke about partial derivatives:
Quote:

A constant function and ex are walking on Broadway. Then suddenly the constant function sees a differential operator approaching and runs away. So e^x follows him and asks why the hurry. "Well, you see, there's this differential operator coming this way, and when we meet, he'll differentiate me and nothing will be left of me...!" "Ah," says ex, "he won't bother ME, I'm e to the x!" and he walks on. Of course he meets the differential operator after a short distance.

ex: "Hi, I'm e^x"

diff.op.: "Hi, I'm d/dy"


text:
# Practical Statistics in R for Comparing Groups: Numerical Variables

(23 customer reviews)

19.99

(This is an ebook)

This R Statistics book provides a solid step-by-step practical guide to statistical inference for comparing groups means using the R software. It is designed to get you doing the statistical tests in R as quick as possible. The book focuses on implementation and understanding of the methods, without having to struggle through pages of mathematical proofs.

You will be guided through the steps of summarizing and visualizing the data, checking the assumptions and performing statistical tests in R, interpreting and reporting the results.

The main parts of the book include: PART I. Statistical tests and assumptions for the comparison of groups means; PART II. comparing two means (t-test, Wilcoxon test, Sign test); PART III. comparing multiple means (ANOVA – Analysis of Variance for independent measures, repeated measures ANOVA, mixed ANOVA, ANCOVA and MANOVA, Kruskal-Wallis test and Friedman test).

Order a Physical Copy on Amazon:

Category:

## Description

This R Statistics book provides a solid step-by-step practical guide to statistical inference for comparing groups means using the R software. Additionally, we developed an R package named rstatix (https://rpkgs.datanovia.com/rstatix/), which provides a simple and intuitive pipe-friendly framework, coherent with the tidyverse design philosophy, for computing the most common statistical analyses, including t-test, Wilcoxon test, ANOVA, Kruskal-Wallis and correlation analyses, outliers identification and more.

This book is designed to get you doing the statistical tests in R as quick as possible. The book focuses on implementation and understanding of the methods, without having to struggle through pages of mathematical proofs.

You will be guided through the steps of summarizing and visualizing the data, checking the assumptions and performing statistical tests in R, interpreting and reporting the results.

## Key features of this book

Although there are several good books on statistics and related topics, we felt that many of them are too theoretical. Our goal was to write a practical guide to statistics in R with visualization, interpretation and reporting the results.

The main parts of the book include:

• statistical tests and assumptions for the comparison of groups means,
• comparing two means,
• t-test,
• Wilcoxon test,
• Sign test,
• comparing multiple means,
• ANOVA - Analysis of Variance for independent measures
• repeated measures ANOVA,
• mixed ANOVA,
• ANCOVA and MANOVA,
• Kruskal-Wallis test
• Friedman test

The book presents the basic principles of these tasks and provide many examples in R. This book offers solid guidance in statistics for students and researchers.

Key features:

• Covers the most common statistical tests and implementations
• Key assumptions are presented and checked
• Short, self-contained chapters with practical examples. This means that, you don’t need to read the different chapters in sequence.

In each chapter, we present R lab sections in which we systematically work through applications of the various methods discussed in that chapter.

## How this book is organized ?

This book contains 3 parts. After a quick introduction to R (Chapter @ref(introduction-to-r)), Part I introduces some research questions and the corresponding statistical tests, as well as, the assumptions of the tests. Many of the statistical methods including t-test and analysis of variance (ANOVA) assume some characteristics about the data, including normality of the data distributions and equality of group variances. These assumptions should be taken seriously to draw reliable interpretation and conclusions of the research. In Part I, you will learn how to assess normality using the Shapiro-Wilk test (Chapter @ref(normality-test-in-r)) and how to compare variances in R using Levene’s test and more (Chapter @ref(homogeneity-of-variance)).

Examples of distribution shapes

• Normal distribution

• Skewed distributions

In Part II, we consider how to compare two means using t-test (parametric method, Chapter @ref(t-test)) and wilcoxon test (non-parametric method, Chapter @ref(wilcoxon-test)). Main contents, include:

1. Comparing one-sample mean to a standard known mean:
• One-Sample T-test (parametric)
• Wilcoxon Signed Rank Test (non-parametric)
2. Comparing the means of two independent groups:
• Independent Samples T-test (parametric)
• Wilcoxon Rank Sum Test (non-parametric)
3. Comparing the means of paired samples:
• Paired Samples T-test (parametric)
• Wilcoxon Signed Rank Test on Paired Samples (non-parametric)

In this Part, we also described how to check t-test assumptions, as well as, how to compute the t-test effect size (Cohen’s d). You will also learn how to compute the Wilcoxon effect size. Additionally, we present the sign test (Chapter @ref(sign-test)), an alternative to the paired-samples t-test and the Wilcoxon signed-rank test, in the situation where the distribution of differences between paired data values is neither normal (in t-test) nor symmetrical (in Wilcoxon test).

Part III describes how to compare multiple means in R using ANOVA (Analysis of Variance) method and variants (Chapters @ref(anova-analysis-of-variance) - @ref(friedman-test)).

Chapter @ref(anova-analysis-of-variance) describes how to compute and interpret the different types of ANOVA for comparing independent measures, including:

• One-way ANOVA, an extension of the independent samples t-test for comparing the means in a situation where there are more than two groups.
• two-way ANOVA for assessing an interaction effect between two independent categorical variables on a continuous outcome variable.
• three-way ANOVA for assessing an interaction effect between three independent categorical variables on a continuous outcome variable.

We also provide R code to check ANOVA assumptions and perform Post-Hoc analyses. Additionally, we’ll present the Kruskal-Wallis test (Chapter @ref(kruskal-wallis-test-in-r)), which is a non-parametric alternative to the one-way ANOVA test.

Chapter @ref(repeated-measure-anova) presents repeated-measures ANOVA, which is used for analyzing data where same subjects are measured more than once. You will learn different types of repeated measures ANOVA, including:

• One-way repeated measures ANOVA for comparing the means of three or more levels of a within-subjects variable.
• two-way repeated measures ANOVA used to evaluate simultaneously the effect of two within-subject factors on a continuous outcome variable.
• three-way repeated measures ANOVA used to evaluate simultaneously the effect of three within-subject factors on a continuous outcome variable.

You will also learn how to compute and interpret the Friedman test (Chapter @ref(friedman-test)), which is a non-parametric alternative to the one-way repeated measures ANOVA test.

Chapter @ref(mixed-anova) shows how to run mixed ANOVA, which is used to compare the means of groups cross-classified by at least two factors, where one factor is a “within-subjects” factor (repeated measures) and the other factor is a “between-subjects” factor.

Chapters @ref(ancova) and @ref(one-way-manova) describe, respectively, some advanced extensions of ANOVA, including:

• ANCOVA (analyse of covariance), an extension of the one-way ANOVA that incorporate a covariate variable.
• MANOVA (multivariate analysis of variance), an ANOVA with two or more continuous outcome variables.

Version: Français

## 23 reviews for Practical Statistics in R for Comparing Groups: Numerical Variables

1. Modeste M. (verified owner)

Very interesting book to read. It provides a very practical guide to statistical inference for comparing groups means using the R software. I highly recommend it.

2. Cees (verified owner)

3. ANYASOR CHIGOZIE (verified owner)

Your book helped we very well but I would have loved to see more practical applications.

4. Rafia (verified owner)

Thanks. Its helpful to understand the analysis in R. It could be convenient if there are more explanations of the parameters. There will be an expectation for a book on Regression analysis with R.

5. Rita L. (verified owner)

Very good books.

6. Anonymous (verified owner)

7. Ioannis M. (verified owner)

Very useful reference for R users that practice statistics regularly.

8. Ognjen (verified owner)

9. Anonymous (verified owner)

10. TC Bakker (verified owner)

The content of the book is rather simple. It missed a good preview from the parts at the middle or end of the book.

11. Anonymous (verified owner)

12. Alberto (verified owner)

The book explains in a very simple way the practice of comparing groups in R, with different tests and methodology. Recommended!

13. Matteo P. (verified owner)

I really enjoed the book, is pretty clear but i would suggest to add some use cases (when a test is better) and a little of math explanation for who has to study these methods

14. Anonymous (verified owner)

This book covers t-test and ANOVA comprehensively. I used quite a few books on these topic and find this book is the best. Thanks to Kassambara for the excellent work!

15. Junji Yanagi (verified owner)

It’s very good. Easy to buy and very reasonable price.

16. Pablo Caceres (verified owner)

Great, great book. It is a practical book, full of instructions and recipes. You can apply its content inmediately. I didn’t rate five stars because there is a lack of some foundations about the statistical procedures. I m not speaking about mathematical foundations, just some explanations related with statistical tests

17. Anonymous (verified owner)

18. Anthony B. (verified owner)

19. Christopher Teh (verified owner)

Straight-to-the-point reference book on using R for various statistical analyses and experimental designs. This is handy for those who simply want to know how to use R to analyze their data without having to go through a copious number of pages about various statistical theories and obtuse mathematical equations that only hardcore statisticians would understand, demand, and appreciate.

One weakness is the use of the author’s own R packages such as rstatix, which while convenient, limits the choices to users. Moreover, rstatix has a bug when using with group_by. Moreover, the development of rstatix appears to have been stalled, where increasing number of issues have been reported by users but without any response by the developer.

20. Astrid (verified owner)

Good overview of different statistical tests and easy to apply, but low explaination of the output of the test beside the p-value.

21. Dang Van Tri (verified owner)

I love this book. It’s beautiful and simple to read. But I’m insteresting with Kaplan–Meier and Cox which not written in your book

22. Josep I. (verified owner)

23. Anonymous (verified owner)

10/10 highly recommend!!

Show reviews in all languages (25)