text:
# Characteristic Portfolio for an Attribute [closed]

Given a vector of attributes(eg.E/P ratios, betas) for N assets

$a^T = {a_1,a_2,...,a_N}$ The exposure of portfolio $h_P$ to attribute a is

$a = \sum_{n}a_n h_{P,n}$

Proposition: There is a unique portfolio $h_a$ that has minimum risk and unit exposure to a. The holdings(weights) of the characteristic portfolio $h_a$ are given by

$h_a = \frac{V^{-1}a}{a^TV^{-1}a}$

For the prrof we write:

Minimise $h^TVh$ subject to constriant : $h^Ta=1$

Using Langrange multiplier we get the equations:

a. $h^Ta = 1$

b. $Vh - \lambda a = 0$

Question: How does substituting a in b yields the result of the proposition ?

## closed as off-topic by Alex C, Helin, LocalVolatility, amdopt, Attack68♦Aug 13 '18 at 17:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Basic financial questions are off-topic as they are assumed to be common knowledge for those studying or working in the field of quantitative finance." – Alex C, Helin, LocalVolatility, amdopt, Attack68
If this question can be reworded to fit the rules in the help center, please edit the question.

From b. we get $Vh = \lambda a$, so $h=\lambda V^{-1}a$ (assuming V is invertible).
Using this to evaluate a. we get $h^Ta = \lambda a^T V^{-1}a=1$ (assuming $V^{-1}$ is symmetric). We can solve this for lambda: $\lambda=\frac{1}{a^T V^{-1}a}$
$$h=\frac{V^{-1}a}{a^T V^{-1}a}$$


text:
# Define random variable distribution given standard normal random variable

I have a homework but I don't know how to solve it or what should I do. Kindly help me or guide me.

Let a constant $a$ satisfy that $\int_{0}^{a}{x^2 e^{-\frac{x^2}{2} }dx} = \int_{a}^{\infty}{x^2 e^{-\frac{x^2}{2} }dx}$

Suppose $X$ is a standard normal random variable. Define $Y$ as follows

$$Y = \left\{ \begin{array}{ll} X & \quad if|X|\geq a \\ -X & \quad if|X| < a \end{array} \right.$$

(a) What is the distribution of $Y$?

(b) Show that $X$ and $Y$ are uncorrelated.

(c) Show that $X$ and $Y$ are not independent.

Actually I don't understand the purpose of given integration function, like how or what can I do with the function. What I understand so far (maybe true or false), I consider when $|X| \geq a$ that's mean $Y = \int_{a}^{\infty}{x^2 e^{-\frac{x^2}{2} }dx}$ and the opposite when $|X| < a$. If I consider this, that's mean Y is uniform distribution because nothing different when |X| is greater or less than $a$. Then to show X and Y are uncorrelated, $Cov(X,Y)=E[XY]-E[X]E[Y]=0$ that means $E[XY]=E[X]E[Y]$. But this understanding is the opposite of (c) question, since this apply when X and Y are independent. Thank you so much for your help.

• Please add the [self-study] tag & read its wiki. Then tell us what you understand thus far, what you've tried & where you're stuck. We'll provide hints to help you get unstuck. – gung - Reinstate Monica Sep 19 '16 at 16:41
• Thank you so much for your guidance. What I understand is, because the integration value is given I consider when $|X| \geq a$ that's mean $Y = \int_{a}^{\infty}{x^2 e^{-\frac{x^2}{2} }dx}$ and the opposite when $|X| < a$. If I consider this, that's mean Y is uniform distribution because nothing different when |X| is greater or less than a – Jyanto Sep 20 '16 at 12:56
• Independence and correlation are different things. Independence has to do with mutual information, and correlation has to do with a specific linear relationship. Draw a scatter-plot of $X$ and $Y$, and that may give you some intuition as to how the correlation might be balanced at 0, while there still is a lot of mutual information. – Matthew Graves Sep 20 '16 at 15:39
• (To be clearer, "mutual information" is a measure of how well I could predict $X$ given $Y$, and how well I could predict $Y$ given $X$. Independence is the statement that there's no mutual information, that is, my ability to predict $Y$ or $X$ is the same as it was before you told me the other one.) – Matthew Graves Sep 20 '16 at 15:40

(a) What happens when you multiply a symmetric distribution by -1? That is, what's the difference between the distribution of $X$ and $-X$?
(b) If two random variables are uncorrelated, then that implies that their covariance is 0. Covariance is $E[(X-E[X])(Y-E[Y])]$, which is made simpler by the fact that $E[X]=E[Y]=0$. What happens when you integrate that across the domain of the function? (The definition of $a$ should come in handy.)
(c) Independence implies that $P(X=x, Y=y)$ factorizes to $P(X=x)P(Y=y)$. Can you exhibit a pair $(x, y)$ where that doesn't hold?
• Jyanto, it's because whenever $x$ is used, it's always $x^2$, which is symmetric around 0. (All polynomials with only even powers are.) – Matthew Graves Sep 20 '16 at 15:34
• Jyanto, sorry, that was a little misleading. $X$'s distribution is a standard normal, which is proportional to $e^{-x^2}$, which is what makes $X$ symmetric. $Y$, viewed by itself, is also a standard normal distribution, but it's worth stepping through how the partial reflection of a symmetric distribution works. – Matthew Graves Sep 20 '16 at 17:44

format: plain


text:
# Tag Info

8

Research papers require references to verify where your data comes from. Schoolkids don't care where you get your data, extra references or footnotes just irritate them. If the presented information is incorrect, you are the one who should bear the grilling. Regarding footnotes vs inline references, as a reader - and a former schoolkid as we all were - I ...

1

My advice is to use the least obtrusive method, probably 4, from your list. And to also minimize the number of citations. What you are considering a feature (oh goodie, we get footnotes) is really more of a bug or at least a pill for someone not already used to wading through research papers. You've got enough headwinds already by combining two difficult ...

2

I think the best thing for a beginner is to focus on concrete interesting mathematics. You definitely do not want to do any abstract stuff at this point unless it is motivated by some concrete problem. I recommend "Nets, Puzzles and Postmen" by Peter Higgins, and later on "How to Prove It" by Daniel Velleman. The first book is a really ...

4

You mention Art of Problem Solving. They have a great curriculum for kids called Beast Academy. You could get that for him, and just be there for when he has questions. It is a lot of fun for many of the kids using it. Also, you could play games with him. (You may have to squelch your desire to teach, just a bit.) I love Blokus and Katamino. There are also ...

1

Take a look at Polya's classic "How to solve it". What you are asking is "how do I teach creative problem solving", and for that, sorry to say, there is no royal road. In any case, it isn't fair to expect your kid to solve a problem you struggle with...

5

You'll probably get a better answer after the question is closed, edited for clarity, and reopened. I have had multiple experiences of this for students for whom English is not their first language. "What is 'ferris wheel'"? Taking a trigonometry test and we were using the ferris wheel in a test question. ('We', but I did not author the test. I was ...

3

I should disclaim I haven't managed to solve this equation yet, even with your description. What were your failed attempts like? What was your own approach to this problem, and can't this approach help your son? Overall my approach for a problem like this would be: in general, to solve for N variables you need N independent equations. Here the problem gives ...

1

Pretty open-ended questions since there aren't any specifics, so I'll give my scenarios: I wouldn't allow another chance if it was mathematically-related word that would have been seen in a previous year. For example a high school student asking what a "numerator" is, or a "sum", or a "factor" etc. (I don't think it's unfair to ...

1

It is not formally described as an AP Calculus course, but it is supposed to map roughly onto Calculus AB. It sounds like there isn't a clear definition for the level of the course or the content that needs to be covered. It may be beneficial to poll the students to find out how many are planning on skipping Calculus II in college and moving straight to ...

2

Reasons to study Newton's method: -It's an application of derivatives -It is a good example of numerical methods -It can help strengthen understanding of relationship between derivative and tangent line -It's likely going to be on the AP test I've put these roughly in order of how important they are to your situation; as nice as it is to get greater ...

7

AP classes have become much more common these days, and at many schools the result has been that very few students actually pass the AP exam with a grade that would allow them to skip the course in college. The trouble is that even if 90% of your students fall in this category, you also have a duty to serve the other 10%. Those students are going to be ...

9

If time constraints are so dire that you risk not getting to cover integrals and the fundamental theorem of calculus, then I'd cut Newton's method (and probably much more) since I don't see how you could pass the test without knowing those former topics. But, if you cut Newton's method from the teaching, wouldn't it still come up in practice AP tests that ...

1

It looks to me like your student just has a different, but valid, idea for approaching the problem. If your student made both of the suggested changes, (1) including all ways of ordering the colors, and (2) dividing by $9!$ rather than $(3!)^3$, they would get the same answer as you got. The main downside to your student's approach is that including all ways ...

Top 50 recent answers are included


text:
# Optimization for routine repeatedly using FindMaximum

I have a routine which repeatedly calls FindMaximum to find the local maxima of f[m,a,b,c] as a function of m only (i.e. considers a,b,c as fixed and then finds the values of m for which the function is a local max).

I know that the FindMaximum algorithm uses Derivative[1,0,0,0][f]. Does this mean that Mathematica will recalculate the derivative every time FindMaximum is called? If so,

1. Is there any way to avoid this (e.g. define explicitly a function equal to Derivative[1,0,0,0][f][m,a,b,c] and get Mathematica to use this function rather than calculating the derivative every time)?
2. If (1.) is feasible, given that I expect a run of the routine to call FindMaximum several thousand times, would it represent a significant time saving?

If it helps, the function is

f[m_,a_,b_,c_]:=(Exp[a(m-b)]+1)^(-1) - c(2+m)/3 + c ((1-m^2)/3)^(1/2)

and the routine calls FindMaximum twice for each value of the parameters a,b,c (starting at m=0.9 and m=-0.9 respectively).

FindMaximum knows the Gradient-Option.

FindMaximum[...,{...,...},Gradient->...]

I used your function and you'll get a speedup at about 23%. (For arbitrary choosen parameters and on my machine of course)

func=f[m,10,0,0];


text:
GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 24 May 2019, 03:09

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# M16-29

Author Message
TAGS:

### Hide Tags

Math Expert
Joined: 02 Sep 2009
Posts: 55272

### Show Tags

16 Sep 2014, 00:59
1
15
00:00

Difficulty:

(N/A)

Question Stats:

44% (02:17) correct 56% (03:08) wrong based on 68 sessions

Each month a retailer sells 100 identical items. On each item he makes a profit of $20 that constitutes 10% of the item's price to the retailer. If the retailer contemplates giving a 5% discount on the items he sells, what is the least number of items he will have to sell each month to justify the policy of the discount? A. 191 B. 213 C. 221 D. 223 E. 226 _________________ Math Expert Joined: 02 Sep 2009 Posts: 55272 Re M16-29 [#permalink] ### Show Tags 16 Sep 2014, 00:59 2 1 Official Solution: Each month a retailer sells 100 identical items. On each item he makes a profit of$20 that constitutes 10% of the item's price to the retailer. If the retailer contemplates giving a 5% discount on the items he sells, what is the least number of items he will have to sell each month to justify the policy of the discount?

A. 191
B. 213
C. 221
D. 223
E. 226

The current net monthly profit $$=20 * 100 =2000$$. The item's price to the retailer = $$\frac{20}{10}*100=200$$. The current selling price of one item $$=200 + \text{ (profit on each item) }=220$$.

The selling price of one item with the discount $$=220 (1 - 0.05) =220 -11 =209$$. The new profit on each item $$=209 -200 =9$$. The new net monthly profit $$= x *9$$ where $$x$$ is the number of items the retailer will sell after the discount is announced. The question is what must be $$x$$ so that the new net monthly profit would exceed the current net monthly profit. In other words, what is the least $$x$$ such that $$9x \gt 2000$$? $$x$$ must be larger than $$\frac{2000}{9} = 222.222..$$. Because $$x$$ has to be an integer, the least $$x$$ is 223.

_________________
Manager
Joined: 14 Jul 2014
Posts: 91

### Show Tags

14 Jan 2015, 06:10
1
what is the least number of items he will have to sell each month to justify the policy of the discount? - KEYWORDS !!

POLICY - Current Profit = 20 * 100 = $2000 has to be maintained !! As per solving stmnts, Profit = 10% CP = 1/10 CP = 1/11 SP { Profit =1/n * CP = 1/(n+1) * SP } .... Formula Hence Profit = 20, CP = 200 , SP = 220 Now, 5% discount on SP = 209. Hence Profit = 209 - 200 =$ 9

The least number of items he will have to sell each month to justify policy
9x > 2000 . x >222.22

or Backsolve
( 9 * What? will give atleast $2000) Ans - D Senior Manager Status: Verbal Forum Moderator Joined: 17 Apr 2013 Posts: 468 Location: India GMAT 1: 710 Q50 V36 GMAT 2: 750 Q51 V41 GMAT 3: 790 Q51 V49 GPA: 3.3 Re: M16-29 [#permalink] ### Show Tags 02 Jul 2015, 01:45 3 Bunuel wrote: Official Solution: Each month a retailer sells 100 identical items. On each item he makes a profit of$20 that constitutes 10% of the item's price to the retailer. If the retailer contemplates giving a 5% discount on the items he sells, what is the least number of items he will have to sell each month to justify the policy of the discount?

A. 191
B. 213
C. 221
D. 223
E. 226

The current net monthly profit $$=20 * 100 =2000$$. The item's price to the retailer = $$\frac{20}{10}*100=200$$. The current selling price of one item $$=200 + \text{ (profit on each item) }=220$$.

The selling price of one item with the discount $$=220 (1 - 0.05) =200 -11 =209$$. The new profit on each item $$=209 -200 =9$$. The new net monthly profit $$= x *9$$ where $$x$$ is the number of items the retailer will sell after the discount is announced. The question is what must be $$x$$ so that the new net monthly profit would exceed the current net monthly profit. In other words, what is the least $$x$$ such that $$9x \gt 2000$$? $$x$$ must be larger than $$\frac{2000}{9} = 222.222..$$. Because $$x$$ has to be an integer, the least $$x$$ is 223.

I belive language is slightly unclear -
$20 that constitutes 10% of the item's price to the retailer. items price refers to Cost Price or selling price, normally Gmat prep question doesn't have that kind of ambiguity. _________________ Like my post Send me a Kudos It is a Good manner. My Debrief: http://gmatclub.com/forum/how-to-score-750-and-750-i-moved-from-710-to-189016.html Senior Manager Joined: 31 Mar 2016 Posts: 376 Location: India Concentration: Operations, Finance GMAT 1: 670 Q48 V34 GPA: 3.8 WE: Operations (Commercial Banking) Re: M16-29 [#permalink] ### Show Tags 20 Aug 2016, 04:44 I think this is a high-quality question and I agree with explanation. Intern Joined: 07 Feb 2010 Posts: 2 Re: M16-29 [#permalink] ### Show Tags 19 Oct 2016, 02:05 1 There are two problems with the wording of this question. Firstly the reference should be to cost and not to 'price to the retailer' which is unclear and confusing. Secondly, the question does not specify that the discount is only applied to some of the products sold. Again unclear and confusing. Intern Joined: 09 Sep 2015 Posts: 20 Re: M16-29 [#permalink] ### Show Tags 29 Mar 2017, 21:17 honchos wrote: Bunuel wrote: Official Solution: Each month a retailer sells 100 identical items. On each item he makes a profit of$20 that constitutes 10% of the item's price to the retailer. If the retailer contemplates giving a 5% discount on the items he sells, what is the least number of items he will have to sell each month to justify the policy of the discount?

A. 191
B. 213
C. 221
D. 223
E. 226

The current net monthly profit $$=20 * 100 =2000$$. The item's price to the retailer = $$\frac{20}{10}*100=200$$. The current selling price of one item $$=200 + \text{ (profit on each item) }=220$$.

The selling price of one item with the discount $$=220 (1 - 0.05) =200 -11 =209$$. The new profit on each item $$=209 -200 =9$$. The new net monthly profit $$= x *9$$ where $$x$$ is the number of items the retailer will sell after the discount is announced. The question is what must be $$x$$ so that the new net monthly profit would exceed the current net monthly profit. In other words, what is the least $$x$$ such that $$9x \gt 2000$$? $$x$$ must be larger than $$\frac{2000}{9} = 222.222..$$. Because $$x$$ has to be an integer, the least $$x$$ is 223.

I belive language is slightly unclear -
$20 that constitutes 10% of the item's price to the retailer. items price refers to Cost Price or selling price, normally Gmat prep question doesn't have that kind of ambiguity. hi, Item's price always refers to selling price. above statement "$20 that constitutes 10% of the item's price to the retailer" can be written as -> 10% of Item Price=$20 =>$200.
Now total Selling Price(SP) = $200+$20(profit on each item) = $220 hope this helps. Intern Joined: 22 Jan 2017 Posts: 33 Re: M16-29 [#permalink] ### Show Tags 30 Sep 2017, 20:48 Yeah, the wording here is pretty ambiguous. Without going into anything else, there is no indication of what criteria are used to evaluate the suitability of the discount whatsoever. The question could very easily have been amended to ask, "what is the least number of items that the retailer must sell such that his net profit exceeds his current profit?" I think this is a good question, but that last line really need a bit more clarity. Manager Joined: 27 Apr 2011 Posts: 52 Location: India GMAT Date: 06-13-2017 Re: M16-29 [#permalink] ### Show Tags 04 Oct 2017, 10:19 Ambiguous Wording of the question.. please rectify ASAP. _________________ Hope it's clear. _________________ Please +1 KUDO if my post helps. Thank you. Manager Joined: 23 Jan 2017 Posts: 70 Re: M16-29 [#permalink] ### Show Tags 13 Dec 2017, 13:30 Language not clear ... "justify the policy of the discount"? The question doesn't express what was the policy of the discount. I just made a guess that the question is trying to ask what is the least number of items he will have to sell so that his monthly profits doesn't decrease. This is not a 700 level question. It is just that the language is making it difficult to comprehend the question. Director Joined: 12 Feb 2015 Posts: 840 Re: M16-29 [#permalink] ### Show Tags 07 Jul 2018, 01:42 honchos wrote: Bunuel wrote: Official Solution: Each month a retailer sells 100 identical items. On each item he makes a profit of$20 that constitutes 10% of the item's price to the retailer. If the retailer contemplates giving a 5% discount on the items he sells, what is the least number of items he will have to sell each month to justify the policy of the discount?

A. 191
B. 213
C. 221
D. 223
E. 226

The current net monthly profit $$=20 * 100 =2000$$. The item's price to the retailer = $$\frac{20}{10}*100=200$$. The current selling price of one item $$=200 + \text{ (profit on each item) }=220$$.

The selling price of one item with the discount $$=220 (1 - 0.05) =200 -11 =209$$. The new profit on each item $$=209 -200 =9$$. The new net monthly profit $$= x *9$$ where $$x$$ is the number of items the retailer will sell after the discount is announced. The question is what must be $$x$$ so that the new net monthly profit would exceed the current net monthly profit. In other words, what is the least $$x$$ such that $$9x \gt 2000$$? $$x$$ must be larger than $$\frac{2000}{9} = 222.222..$$. Because $$x$$ has to be an integer, the least $$x$$ is 223.

I belive language is slightly unclear -
$20 that constitutes 10% of the item's price to the retailer. items price refers to Cost Price or selling price, normally Gmat prep question doesn't have that kind of ambiguity. I agree the question per se is very easy but the ambiguity in wording leaves it open for interpretation & then its like you are gambling rather than solving GMAT quant. _________________ "Please hit +1 Kudos if you like this post" _________________ Manish "Only I can change my life. No one can do it for me" Manager Joined: 01 Aug 2017 Posts: 189 Location: India Concentration: General Management, Leadership GMAT 1: 500 Q47 V15 GPA: 3.4 WE: Information Technology (Computer Software) Re: M16-29 [#permalink] ### Show Tags 26 Aug 2018, 09:07 Each month a retailer sells 100 identical items. On each item he makes a profit of$20 that constitutes 10% of the item's price to the retailer. If the retailer contemplates giving a 5% discount on the items he sells, what is the least number of items he will have to sell each month to justify the policy of the discount?

A. 191
B. 213
C. 221
D. 223
E. 226

The current net monthly profit $$=20 * 100 =2000$$.
$20 constitutes 10% of the item's price to the retailer. It implies 20 = 10/100 * retail price of the item The retail price of one item = $$\frac{(20*100)}{10}= 200$$. The selling price of one item $$=200 + \text{ (profit on each item) }=220$$. Discount is 5%. There fore New Selling price is 95% of$220
After Discount, new selling price of one item $$=220 * 0.95 =209$$.
The new profit on each item $$=209 -200 =9$$.

Let the no of items retailer would sell at discounted price be $$x$$.

The new net monthly profit $$= x *9$$

The question is what must be $$x$$ so that the new net monthly profit would exceed or equal the current net monthly profit.
$$x *9 >= 2000$$
$$x >= 2000/9$$.
$$x>= 222.222$$
Because $$x$$ is number of item, hence it must be an integer. Nearest value $$x$$ is 223.

_________________
If it helps you please press Kudos!

Thank You
Sudhanshu
Manager
Joined: 22 Jun 2017
Posts: 178
Location: Argentina
Schools: HBS, Stanford, Wharton
GMAT 1: 630 Q43 V34

### Show Tags

20 Feb 2019, 19:38
I think this is a high-quality question and I agree with explanation. I would modify this question as for me it wasn't so clear what "justify the policy of the discount" means. Is it to cover the cost? or to have the same profits?
_________________
The HARDER you work, the LUCKIER you get.
Manager
Joined: 22 Jun 2017
Posts: 178
Location: Argentina
Schools: HBS, Stanford, Wharton
GMAT 1: 630 Q43 V34

### Show Tags

20 Feb 2019, 19:47
I think this is a high-quality question and I don't agree with the explanation. The solution says:
The selling price of one item with the discount =$220(1−0.05)=$200−$11=$209=$220(1−0.05)=$200−$11=$209.

BUT, 200-11 is not 209.. 220-11 is 209.
_________________
The HARDER you work, the LUCKIER you get.
Intern
Joined: 13 Sep 2018
Posts: 14

### Show Tags

23 Mar 2019, 00:07
Bunuel wrote:
Official Solution:

Each month a retailer sells 100 identical items. On each item he makes a profit of $20 that constitutes 10% of the item's price to the retailer. If the retailer contemplates giving a 5% discount on the items he sells, what is the least number of items he will have to sell each month to justify the policy of the discount? A. 191 B. 213 C. 221 D. 223 E. 226 The current net monthly profit $$=20 * 100 =2000$$. The item's price to the retailer = $$\frac{20}{10}*100=200$$. The current selling price of one item $$=200 + \text{ (profit on each item) }=220$$. The selling price of one item with the discount $$=220 (1 - 0.05) =220 -11 =209$$. The new profit on each item $$=209 -200 =9$$. The new net monthly profit $$= x *9$$ where $$x$$ is the number of items the retailer will sell after the discount is announced. The question is what must be $$x$$ so that the new net monthly profit would exceed the current net monthly profit. In other words, what is the least $$x$$ such that $$9x \gt 2000$$? $$x$$ must be larger than $$\frac{2000}{9} = 222.222..$$. Because $$x$$ has to be an integer, the least $$x$$ is 223. Answer: D Bunuel can you kindly explain how you calculated the current selling price of$220 am having a hard time wrapping my head around how you came up with the answer and also what does justify the discount policy mean.
Manager
Joined: 18 Jul 2018
Posts: 51
Location: United Arab Emirates

### Show Tags

05 Apr 2019, 10:30
bridgetnamugga wrote:
Bunuel wrote:
Official Solution:

Each month a retailer sells 100 identical items. On each item he makes a profit of $20 that constitutes 10% of the item's price to the retailer. If the retailer contemplates giving a 5% discount on the items he sells, what is the least number of items he will have to sell each month to justify the policy of the discount? A. 191 B. 213 C. 221 D. 223 E. 226 The current net monthly profit $$=20 * 100 =2000$$. The item's price to the retailer = $$\frac{20}{10}*100=200$$. The current selling price of one item $$=200 + \text{ (profit on each item) }=220$$. The selling price of one item with the discount $$=220 (1 - 0.05) =220 -11 =209$$. The new profit on each item $$=209 -200 =9$$. The new net monthly profit $$= x *9$$ where $$x$$ is the number of items the retailer will sell after the discount is announced. The question is what must be $$x$$ so that the new net monthly profit would exceed the current net monthly profit. In other words, what is the least $$x$$ such that $$9x \gt 2000$$? $$x$$ must be larger than $$\frac{2000}{9} = 222.222..$$. Because $$x$$ has to be an integer, the least $$x$$ is 223. Answer: D Bunuel can you kindly explain how you calculated the current selling price of$220 am having a hard time wrapping my head around how you came up with the answer and also what does justify the discount policy mean.

Hi bridgetnamugga

Its mentioned in the question stem that "On each item he makes a profit of \$20"
This implies that S.P = 220
HOW?

We calculated earlier, C.P = 200
Hence,
Profit = S.P - C.P
20 = S.P - 200
220 = S.P

Now, Question is asking for "what is the least number of items he will have to sell each month to justify the policy of the discount?"

The retailer plans on a discount policy of 5% on the items he sells.
So, 220*0.05 = 11
220 - 11 = 209
SP after discount = 209

NEW PROFIT = 209 - 200 = 9

Since, CURRENT MONTHLY PROFIT = 20 * 100 = 2000
MONTHLY PROFIT AFTER DISCOUNT = 9*x (where x is the # of items required to sell to justify discount policy)

In order to "justify discount policy" the profit earned with discount policy should be more than the current profit earned

OR
what must be x so that the new net monthly profit is more than the current net monthly profit.

Hence,
9x > 2000
x > 2000/9
x > 222.22
# of items has to be an integer value so the closest next value is 223.

Hope this helps!
M16-29   [#permalink] 05 Apr 2019, 10:30
Display posts from previous: Sort by

# M16-29

Moderators: chetan2u, Bunuel

 Powered by phpBB © phpBB Group | Emoji artwork provided by EmojiOne Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®.


text:
# Why hasn't the median function made the mean (effectively) obsolete?

I've learned in my AP statistics class that means can really only be used on nearly-normal distributions, but I know that many studies, experiments, etc. don't always give that perfect normal curve that one might find on a histogram.

Why use medians?

To my knowledge medians are a good averaging function because they are able to eliminate outliers. Consider finding the averages of the amount of money a person makes in a career. Typically, the curve would be skewed and there would be leveraging points (such as the high amount of money people with executive positions in a career would be making).

Point: Medians are Means I've noticed that as a data-set becomes more and more normal, or 'better' suited for the use of a mean, the median approaches the value of the mean. If the median takes care of outliers and skewed data and embodies the value of the mean when it meets the 'conditions' of the mean, Why isn't the median always favored over the mean? (especially with the influx of computer based averaging solutions that would effectively eliminate the issue of efficiency of calculation for either averaging function)

• Means have a lot of properties that make them easier to use. For example, if you know the median test score at school A with 100 students and the median score at school B with 200 students, what is the median score for the two schools? Can't figure it out? You can with means. – Thomas Andrews Mar 2 '15 at 3:28
• Why do you not like outliers? That data contains information too. The "law of large numbers" is useful for means. – Michael Mar 2 '15 at 3:29
• Also, the median is always more complicated to calculuate - you have to sort your data set, which, when data sets are huge, is very costly. Means take $O(N)$ time, while medians take $O(n\log n)$ time and quite a lot more space. – Thomas Andrews Mar 2 '15 at 3:30
• I actually think this question is really interesting, and I want to see what a real probs/stats person has to say. My two cents: means are easier to work with because they are linear. They can be computed inline, updated when a new piece of data arrives ( real time! ), approximated well based on old mean and new data, etc. Secondly, sometimes you're using the mean as a quick abbreviation for the total, and you can recover that from knowing the number of samples and the mean; the median is not helpful here. – Callus Mar 2 '15 at 3:31
• I guess I have been demoted by Callus. – Michael Mar 2 '15 at 3:35

At the AP level it may be best for you to focus on some examples. The mean and the median are two of many different ways to summarize data. Presumably, the person who took the trouble to collect the data had a reason for doing so, and it is important for a statistician to understand that reason.

Salaries of employees at a company. These will often have a lot of lower numbers with a few high numbers mixed in. The median might give a fairer summary of what most workers get paid. If someone is interested in how to find the money to pay everyone, then the mean would probably be best because it is derived from the total payroll. If we are interested in the impact of raising the minimum wage, we may ignore both the mean and the median and just look at the salaries of the worst paid quarter of the workers.

Breath flow of asthma patients. Such patients may be asked to blow out as much air as possible in a short time while we measure the volume. There may be a lot of really low numbers. Maybe the median is best for focusing on those. But I would want to know what the lowest numbers really mean. Do they indicate patients whose asthma is under pretty good control but just the worst of our group, or do they indicate people who are in really serious trouble and need emergency attention? If I'm wondering whether these patients are breathing more freely than another group we saw last week, I might want to compare the means of the two groups.

Earthquake magnitudes. You can go onto a website and get the magnitudes of all earthquakes in California for the last month. There will be a lot of very low numbers corresponding to seismic events detectable only by very sensitive instruments. (Normally, values below about 1.5 on the Richter scale are ignored because they may have been mining explosions, construction noise, etc.) There may be a few quakes around 3 or 4 on the scale, that were felt only by a few people near the epicenter and that did no real damage. If there happens to be one quake with magnitude 6.5, that may the one and only number out of a few hundred that is of any importance to the general public. For most people this outlier is the only number that matters.

Ordinal scale data. Suppose you have data from a poll asking whether people favor a tax on sugary sodas to pay for after school athletics. Possible responses might be '1=Strongly oppose', '2=Oppose', '3=Neutral', '4=Favor', and '5=Strongly Favor'. Because these opinions can be sorted in order from most opposed to most in favor, we could pick out the middle opinion in the ordered list and say that is the median opinion. It is questionable whether the mean would be of any use. (The numbers are just substitute labels and can't really be added, so there is no true sum and no real mean.) Maybe the mode, the most common opinion would be of interest.

Grade point averages can be difficult to interpret for similar reasons. Grades F, F, A, A are hardly the same thing as four C's. Historically, GPAs came to be used because averages of many 'numbers' are easier to compute than medians, and computation of GPMs (Grade Point Medians) would have been impossible before modern computers. You can think about whether GPMs might be better than GPAs.

Measures of Dispersion. Sometimes measures of dispersion such as the standard deviation are important in addition to measures of centrality such as the mean and median. The mean annual temperature at some places in the Midwestern US are the same as in the San Francisco Bay Area. But the dispersion of temperatures is markedly larger in the Midwest. If you get a mean (or median) of 55 from numbers between 35 and 85 (Fahrenheit), it's a lot different from getting a mean (or median) of 55 from numbers that range from -20 to 110.

Understand first, summarize second. Nowadays statisticians are dealing with larger and larger datasets. In the future we will undoubtedly need descriptive statistics other than the ones that can be discussed in AP statistics classes.

I don't mean to ignore 'properties' of the mean and median. It is worthwhile noting that if you have means from two groups of 20 you can find the mean of all 40, but this doesn't work for medians. But the important starting place is to understand the purpose and meaning of the data and then use descriptive statistics (and graphs) that honestly convey that meaning.

I know it is common in elementary statistics courses--especially ones taught by people who have done little real data analysis--to refer to the mean, median, standard deviation, etc. as "functions." But that word focuses attention on the mechanics. Maybe it's more useful to think of these numbers as "descriptions."


text:
# How to pass to a new slide on Beamer?

On beamer document class I would like to know how to start writing on a new slide?

There is a bunch of text that the current slide had not enough space, so the text is not complete.

I know that for a document class Article one could use \newpage but it's not working on Beamer

Why?

Help me please

• You have frame environment. Just put the "outside" text to the next frame. – user156344 Mar 23 at 19:52
• The [allowframebreaks] option might also be interesting. – leandriis Mar 23 at 20:38
• @leandriis how to use that inside a \begin{enumerate} ? – user178403 Mar 23 at 20:48
• \begin{frame}[allowframebreaks] \begin{enumerate} <your items> \end{enumerate} \end{frame} Apart from that, it is (almost) always a good idea to add a minimal working example (MWE) to illustrate your question and show what you tried so far. – leandriis Mar 23 at 21:18

## 1 Answer

The allowframebreaks option automatically splits the contents of a frame over several frames if the contents don't fit into a single frame. This also works if the frame contains an enumerate environment.

\documentclass{beamer}

\begin{document}

\begin{frame}[allowframebreaks]
\begin{enumerate}
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\item item
\end{enumerate}
\end{frame}

\end{document}

• Thanks for removing this from the list of unanswered questions! – user36296 Mar 24 at 16:12


text:
Finite Math Examples

Remove the negative exponent by rewriting as .
Raise to the power of to get .
The result can be shown in both exact and decimal forms.
Exact Form:
Decimal Form:


text:
# Delay filters in Python using for loop and $\tt lfilter$

I have these two filters as given in recursive form: \begin{align} y_1[i] &= y[i] - y[i-d] + 1.2y_1[i-d] - 0.8y_1[i-2d]\\ y_2[i] &= y[i] - 2y[i-d] + y[i-2d] \end{align}

where $d$ is an integer for setting the delay. I wanted to have a look and see how such filters change input signals depending on the value of $d$, but I faced the problem with implementing the actual filters in Python: I tried iterations and scipy.signal.lfilter, and each method was giving me different results. Let me show you the code:

import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import lfilter
# The test signal is just a sine of the length l, constant amplitude of 1
# and varying frequency w
l = 1024
x = np.array(range(l))
w = x/l
y = np.sin(w*x)
d = 4

# Let's caclulate the signals filtered with IIR filter
## First using forward iteration
y11 = y.copy()
for i in range(2*d, l):
y11[i] = y[i] - y[i-d] + 1.2*y11[i-d] - 0.8*y11[i-2*d]
## Second using backward iteration
y12 = y.copy()
for i in reversed(range(2*d, l)):
y12[i] = y[i] - y[i-d] + 1.2*y12[i-d] - 0.8*y12[i-2*d]
## Third using lfilter
y13 = lfilter([1, 0, 0, 0, 1], [1, 0, 0, 0, -1.2, 0, 0, 0, 0.8], y)

# Let's caclulate the signals filtered with FIR filter
## First using forward iteration
y21 = y.copy()
for i in range(2*d, l):
y21[i] = y[i] - 2*y[i-d] + y[i-2*d]
## Second using backward iteration
y22 = y.copy()
for i in reversed(range(2*d, l)):
y22[i] = y[i] - 2*y[i-d] + y[i-2*d]
## Third using lfilter
y23 = lfilter([1, 0, 0, 0, 2, 0, 0, 0, -1], [1], y)

# Let's start the figure and plot the signal in the top row, then the filtered
# signals below it
fig = plt.figure()
ax1 = plt.subplot(421)
plt.title('Test signal')
plt.plot(x, y)
ax2 = plt.subplot(422)
plt.title('Test signal')
plt.plot(x, y)

# The left column is for the IIR-filtered signals
plt.subplot(423, sharex=ax1)
plt.title('Forward iter.')
plt.plot(x, y11)
plt.subplot(425, sharex=ax1)
plt.title('Backward iter.')
plt.plot(x, y12)
plt.subplot(427, sharex=ax1)
plt.title('lfilter')
plt.plot(x, y13)

# The right column is for the FIR-filtered signals
plt.subplot(424, sharex=ax2)
plt.title('Forward iter.')
plt.plot(x, y21)
plt.subplot(426, sharex=ax2)
plt.title('Backward iter.')
plt.plot(x, y22)
plt.subplot(428, sharex=ax2)
plt.title('lfilter')
plt.plot(x, y23)

plt.tight_layout()
plt.show()

And here's the resulting figure:

Judging by the look of the plots in rows 2 to 4 one can see that each calculation produced different results except the 2nd and 3rd plot in the right column where backward and forward iteration worked out similarly. Normally I would rely on the results from Scipy's lfilter, but there I'm not sure if I specified the coefficients correctly. Somebody please take look and point out the mistakes.

After a trial-and-error session I figured what was wrong in my code:

• The coefficients I fed to lfilter had incorrect signs, because only the signs of the coeffs from the a array have to be reversed and those in the array b stays the same.

• The backward iteration did not work properly for the IIR filter, because when running backwards the delayed values were not yet filtered and in that case equal to the input signal.

Here is the fixed code:

l = 1024
x = np.array(range(l))
w = x/l
y = np.sin(w*x)
d = 4

# Let's caclulate the signals filtered with IIR filter
## First using forward iteration
y11 = y.copy()
for i in range(2*d, l):
y11[i] = y[i] - y[i-d] + 1.2*y11[i-d] - 0.8*y11[i-2*d]
## Second using backward iteration
y12 = y.copy()
for i in reversed(range(2*d, l)):
y12[i] = y[i] - y[i-d] + 1.2*y12[i-d] - 0.8*y12[i-2*d]
## Third using lfilter
# was:
#y13 = lfilter([1, 0, 0, 0, 1], [1, 0, 0, 0, -1.2, 0, 0, 0, 0.8], y)
y13 = lfilter([1, 0, 0, 0, -1], [1, 0, 0, 0, -1.2, 0, 0, 0, 0.8], y)

# Let's caclulate the signals filtered with FIR filter
## First using forward iteration
y21 = y.copy()
for i in range(2*d, l):
y21[i] = y[i] - 2*y[i-d] + y[i-2*d]
## Second using backward iteration
y22 = y.copy()
for i in reversed(range(2*d, l)):
y22[i] = y[i] - 2*y[i-d] + y[i-2*d]
## Third using lfilter
# was:
#y23 = lfilter([1, 0, 0, 0, 2, 0, 0, 0, -1], [1], y)
y23 = lfilter([1, 0, 0, 0, -2, 0, 0, 0, 1], [1], y)

# Let's start the figure and plot the signal in the top row, then the filtered
# signals below it
fig = plt.figure()
ax1 = plt.subplot(421)
plt.title('Test signal')
plt.plot(x, y)
ax2 = plt.subplot(422)
plt.title('Test signal')
plt.plot(x, y)

# The left column is for the IIR-filtered signals
plt.subplot(423, sharex=ax1)
plt.title('Forward iter.')
plt.plot(x, y11)
plt.subplot(425, sharex=ax1)
plt.title('Backward iter.')
plt.plot(x, y12)
plt.subplot(427, sharex=ax1)
plt.title('lfilter')
plt.plot(x, y13)

# The right column is for the FIR-filtered signals
plt.subplot(424, sharex=ax2)
plt.title('Forward iter.')
plt.plot(x, y21)
plt.subplot(426, sharex=ax2)
plt.title('Backward iter.')
plt.plot(x, y22)
plt.subplot(428, sharex=ax2)
plt.title('lfilter')
plt.plot(x, y23)

plt.tight_layout()
plt.show()

Now on the plots it is clearly visible that iterations produce the same results as scipy's lfilter except for the backward iteration attempt at the IIR filter as it was explained above.


text:
# The argument in “Why most published research findings are false”¶

I spent some time trying to understand the argument in this paper:

• Ioannidis, John PA. 2005. “Why most published research findings are false.” PLoS medicine 2 (8): e124.

These papers were useful for understanding the argument:

• Goodman, Steven, and Sander Greenland. 2007. “Assessing the unreliability of the medical literature: a response to ‘why most published research findings are false.’” Johns Hopkins University, Dept. of Biostatistics Working Papers.
• Kass, Robert E., and Adrian E. Raftery. 1995. “Bayes factors.” Journal of the American Statistical Association 90 (430): 773–795.
• Wacholder, Sholom, Stephen Chanock, Montserrat Garcia-Closas, Nathaniel Rothman, and others. 2004. “Assessing the probability that a positive report is false: an approach for molecular epidemiology studies.” Journal of the National Cancer Institute 96 (6): 434–442.

# “The practice of science is profoundly broken”. Discuss? - no - model and test!¶

The point that Ioannidis makes is:

We know that the scientific process is flawed in a variety of ways. We assume that these flaws do not have a large effect on the outcome. But, if we model some of the flaws, we see that their effect can be catastrophic, in the sense that a large proportion of scientific findings are likely to be wrong.

We scientists commit ourselves to rational thinking. In this case, rational thinking is asking, “how likely is it that we are getting the answers wrong”?. We have to ask this question in a rational way. This is what Ioannidis sets out to do in this paper.

# Different ways of phrasing the argument¶

The basis of Ioannidis’ argument comes from Wacholder et al 2004 (see appendix table 1). Goodman and Greenland 2007 explain Ioannidis in terms of Bayes theorem.

Both Ioannidis and Goodman & Greenland use odds ratios rather than probability values in their exposition. I found it easier to think in terms of probabilities.

# Some terms¶

We’ve done an experiment, and we have conducted a statistical test:

• $$H_A$$ - alternative hypothesis
• $$H_0$$ - null hypothesis
• $$\alpha$$ : false positive rate - probability for test to reject $$H_0$$ when $$H_0$$ is true ($$H_A$$ is false)
• $$\beta$$ : false negative rate - probability for test to accept $$H_0$$ when $$H_A$$ is true ($$H_0$$ is false)
• $$1 - \beta$$ : power - probability we will reject $$H_0$$ if $$H_A$$ is true ($$H_0$$ is false)

Let’s say that the test can either be “significant” (test gives $$p \le \alpha$$) or “not significant” ($$p > \alpha$$). Denote “test is significant” by $$T_S$$, “test not significant” by $$T_N$$.

Before we did the experiment there were two possibilities - $$H_A$$ is true, or $$H_0$$ is true. After we have four possibilities:

• $$H_A \land T_S$$ : $$H_A$$ is true, test is significant;
• $$H_A \land T_N$$ : $$H_A$$ is true, test is not significant;
• $$H_0 \land T_S$$ : $$H_0$$ is true ($$H_A$$ is false) - test is significant;
• $$H_0 \land T_N$$ : $$H_0$$ is true ($$H_A$$ is false) - test is not significant.

# What does a “significant” statistical test result tell us?¶

In this section we work up slowly to Ioannidis table 1.

First we need to load functions for symbolic mathematics from the Sympy library:

>>> from sympy import symbols, Eq, solve, simplify, lambdify, init_printing, latex
>>> init_printing(use_latex=True, order='old')

If we do not take any prior probabilities into account, then we have the following probabilities:

 $$T_S$$ $$T_N$$ $$H_A$$ $$1 - \beta$$ $$\beta$$ $$H_0$$ $$\alpha$$ $$1 - \alpha$$ Total $$1 + \alpha - \beta$$ $$1 + \beta - \alpha$$

$$\newcommand{Frac}[2]{\frac{\displaystyle #1}{\displaystyle #2}}$$

Some new terms:

• $$Pr(H_A)$$ - prior probability of $$H_A$$ - probability of $$H_A$$ before the experiment was conducted.
• $$Pr(H_0)$$ - prior probability of $$H_0$$ = $$1 - Pr(H_A)$$ - probability of null hypothesis before experiment conducted

We are interested in updating the probability of $$H_A$$ and $$H_0$$ as a result of a test on some collected data. This updated probability is $$Pr(H_A | T)$$ - the probability of $$H_A$$ given the test result $$T$$. $$Pr(H_A | T)$$ is called the posterior probability because it is the probability after the test result.

The test result $$T$$ is assumed to have arisen under either $$H_A$$ or $$H_0$$.

$$Pr(T) = Pr(T | H_A) Pr(H_A) + Pr(T | H_0) Pr(H_0)$$

Also the probability of a signficant result of the test $$T_S$$ is from the same formula:

$$Pr(T_S) = Pr(T_S | H_A) Pr(H_A) + Pr(T_S | H_0) Pr(H_0)$$

(From Kass & Rafferty 1995)

Remembering Bayes theorem:

$$P(A | B) = \Frac{P(B | A) P(A)}{P(B)}$$

Bayes theorem gives:

$$P(H_A | T) = \Frac{Pr(T | H_A) Pr(H_A)}{Pr(T)} = \Frac{Pr(T | H_A) Pr(H_A)}{Pr(T | H_A) Pr(H_A) + Pr(T | H_0) Pr(H_0)}$$

Consider only the test result $$T_S$$ (the test is significant). What is the posterior probability of $$H_A$$ given that the test is significant?

$$P(H_A | T_S) = \Frac{Pr(T_S | H_A) Pr(H_A)}{Pr(T_S | H_A) Pr(H_A) + Pr(T_S | H_0) Pr(H_0)}$$

We have $$Pr(T_S | H_A)$$, $$Pr(T_S | H_0)$$ from the first column of the table above. Substituting into the equation:

$$P(H_A | T_S) = \Frac{(1 - \beta) Pr(H_A)}{(1 - \beta) Pr(H_A) + \alpha Pr(H_0)}$$

To make this a little less cluttered, define:

$$\pi := Pr(H_A)$$

So

$$1 - \pi = Pr(H_0)$$

and:

$$P(H_A | T_S) = \Frac{(1 - \beta) \pi}{(1 - \beta) \pi + \alpha (1 - \pi)}$$

Let’s put that formula into Sympy for later:

>>> from sympy.abc import alpha, beta, pi # get symbolic variables
>>> post_prob = (1 - beta) * pi / ((1 - beta) * pi + alpha * (1 - pi))
>>> post_prob
pi*(-beta + 1)/(alpha*(-pi + 1) + pi*(-beta + 1))

A table shows the new probabilities that take the prior into account:

 $$T_S$$ $$T_N$$ $$H_A$$ $$\pi \left(1 - \beta\right)$$ $$\beta \pi$$ $$H_0$$ $$\alpha \left(1 - \pi\right)$$ $$\left(1 - \alpha\right) \left(1 - \pi\right)$$ Total $$\alpha \left(1 - \pi\right) + \pi \left(1 - \beta\right)$$ $$\beta \pi + \left(1 - \alpha\right) \left(1 - \pi\right)$$

This table is equivalent to Ioannidis table 1. The first column of the table gives the probabilities in the case we’re interested in, of $$T_S$$. The posterior probability is the first row, first column - $$Pr(T_S | H_A)$$, divided by the total row, first column - $$Pr(T_S)$$.

Ioannidis uses “positive predictive value” (PPV) for the posterior probability $$P(H_A | T_S)$$. Goodman and Greenland complain, reasonably enough, that “positive predictive value” is a confusing new term for a standard concept.

Ioannidis also prefers his equations in terms of $$R$$ - the prior odds ratio. $$R := \Frac{Pr(H_A)}{Pr(H_0)}$$. Also (from $$\pi := Pr(H_A)$$ and $$Pr(H_0) = 1 - Pr(H_A)$$): $$R = \Frac{\pi}{1 - \pi}$$.

Ioannidis’ formula for PPV is $$\Frac{(1 - \beta) R}{R - \beta R + \alpha}$$. This is the same as our formula above, only rephrased in terms of $$R$$:

>>> R = pi / (1 - pi)
>>> ppv = (1 - beta) * R / (R - beta * R + alpha)
>>> # Is this the same as our formula above?
>>> simplify(ppv - post_prob) == 0
True

The posterior probability is our estimate of whether $$H_A$$ is true, given our prior knowledge $$Pr(H_A) = \pi$$ combined with the new information from the test result.

# What is a finding that is likely to be true?¶

A finding that is likely to be true is one for which the posterior probability $$Pr(H_A | T_S) > 0.5$$. That is, the likelihood of the tested hypothesis, given the reported significant test result, is greater than $$0.5$$

# Whether a finding is likely to be true depends on the power of the experiment¶

Assume that $$\alpha = 0.05$$ (standard significance threshold for null hypothesis test).

Let’s have a look at the posterior probability as a function of power and prior probability:

(png, hires.png, pdf)

The posterior probability depends on the power. If the power is low and $$H_A$$ is true, the likelihood of getting a significant test result is small. Assuming $$\pi = Pr(H_A) = 0.5$$, our posterior probability is given by $$\Frac{(1 - \beta)}{(1 - \beta) + \alpha}$$. As the chance of finding a true positive $$= 1-\beta$$ drops towards the chance of finding a false negative $$= \alpha$$, our confidence in the truth of the significant result must drop too.

The posterior likelihood also depends on the prior. When the prior $$Pr(H_A)$$ drops then we become more wary of the (apriori more unlikely) true positive compared to the (apriori more likely) false positive.

As you can see from the figure. When power is 0.2, and the prior probability is less than around 0.2, then even if there is a significant test result, the null is still more likely than the $$H_A$$ (posterior < 0.5).

# Quantifying the effect of bias¶

Working scientists know that working scientists have many sources of bias in data collection and analysis.

We tend to assume that the effect of this bias is relatively minor. Is this true?

Ioannidis quantifies bias with a parameter $$u$$. $$u$$ is the proportion of not-significant findings that become significant as a result of bias. Put another way, the effect of bias is the result of taking the second column in the probability table above (the not-significant findings) and multiplying by $$u$$. We add this effect to the first column (significant findings) and subtract from the second column (not-significant findings). Before applying the priors, this looks like:

>>> u = symbols('u')
>>> bias_assoc_noprior = dict(t_s = (1 - beta) + u * beta,
...                           t_ns = beta - u * beta,
...                           f_s = alpha + u * (1 - alpha),
...                           f_ns = (1 - alpha) - u * (1 - alpha))

 $$T_S$$ $$T_N$$ $$H_A$$ $$1 - \beta + \beta u$$ $$\beta - \beta u$$ $$H_0$$ $$\alpha + u \left(1 - \alpha\right)$$ $$1 - \alpha - u \left(1 - \alpha\right)$$ Total $$1 + \alpha - \beta + \beta u + u \left(1 - \alpha\right)$$ $$1 + \beta - \alpha - \beta u - u \left(1 - \alpha\right)$$

After applying the prior:

>>> bias_assoc = bias_assoc_noprior.copy()
>>> bias_assoc['t_s'] *= pi
>>> bias_assoc['t_ns'] *= pi
>>> bias_assoc['f_s'] *= 1 - pi
>>> bias_assoc['f_ns'] *= 1 - pi

 $$T_S$$ $$T_N$$ $$H_A$$ $$\pi \left(1 - \beta + \beta u\right)$$ $$\pi \left(\beta - \beta u\right)$$ $$H_0$$ $$\left(1 - \pi\right) \left(\alpha + u \left(1 - \alpha\right)\right)$$ $$\left(1 - \pi\right) \left(1 - \alpha - u \left(1 - \alpha\right)\right)$$ Total $$\pi \left(1 - \beta + \beta u\right) + \left(1 - \pi\right) \left(\alpha + u \left(1 - \alpha\right)\right)$$ $$\pi \left(\beta - \beta u\right) + \left(1 - \pi\right) \left(1 - \alpha - u \left(1 - \alpha\right)\right)$$

The first cell in the table is $$Pr(T_S | H_A) Pr(H_A)$$. The total for the first column gives $$Pr(T_S)$$. Therefore the posterior probability $$Pr(H_A | T_S)$$ is:

>>> post_prob_bias = bias_assoc['t_s'] / (bias_assoc['t_s'] +
...                                       bias_assoc['f_s'])
>>> post_prob_bias
pi*(beta*u - beta + 1)/(pi*(beta*u - beta + 1) + (alpha + u*(-alpha + 1))*(-pi + 1))

>>> # Same as Ioannidis formulation?
>>> # This from Ioannidis 2005:
>>> ppv_bias = (
...     ((1 - beta) * R + u * beta * R) /
...     (R + alpha - beta * R + u - u * alpha + u * beta * R)
...    )
>>> # Is this the same as our formula above?
>>> simplify(ppv_bias - post_prob_bias) == 0
True

What effect does bias have on the posterior probabilities?

(png, hires.png, pdf)

As we’d expect, as bias increases to 1, the result of the experiment has less and less effect on our posterior estimate. If the analysis was entirely biased, then our posterior estimate is unchanged from the prior (diagonal line on the graph).

# The effect of multiple studies¶

Ioannidis makes the point that when a field is particularly fashionable, there may be many research groups working on the same question.

Given publication bias for positive findings, it is possible that only positive research findings will be published. If $$n$$ research groups have done the same experiment, then the probability that all the $$n$$ studies will be not significant, given $$H_A$$ is true, is $$\beta^n$$. Conversely the probability that there is at least one positive finding in the $$n$$ tests is $$1 - \beta^n$$. Similarly the probability that all $$n$$ studies will be not significant, given $$H_0$$, is $$(1 - \alpha)^n$$. The probability of at least one false positive is $$1 - (1 - \alpha)^n$$.

The probability table (without the priors) is:

>>> n = symbols('n')
>>> multi_assoc_noprior = dict(t_s = (1 - beta ** n),
...                           t_ns = beta ** n,
...                           f_s = 1 - (1 - alpha) ** n,
...                           f_ns = (1 - alpha) ** n)

 $$T_S$$ $$T_N$$ $$H_A$$ $$1 - \beta^{n}$$ $$\beta^{n}$$ $$H_0$$ $$1 - \left(1 - \alpha\right)^{n}$$ $$\left(1 - \alpha\right)^{n}$$ Total $$2 - \beta^{n} - \left(1 - \alpha\right)^{n}$$ $$\beta^{n} + \left(1 - \alpha\right)^{n}$$

Considering the prior:

>>> multi_assoc = multi_assoc_noprior.copy()
>>> multi_assoc['t_s'] *= pi
>>> multi_assoc['t_ns'] *= pi
>>> multi_assoc['f_s'] *= 1 - pi
>>> multi_assoc['f_ns'] *= 1 - pi

 $$T_S$$ $$T_N$$ $$H_A$$ $$\pi \left(1 - \beta^{n}\right)$$ $$\pi \beta^{n}$$ $$H_0$$ $$\left(1 - \pi\right) \left(1 - \left(1 - \alpha\right)^{n}\right)$$ $$\left(1 - \alpha\right)^{n} \left(1 - \pi\right)$$ Total $$\pi \left(1 - \beta^{n}\right) + \left(1 - \pi\right) \left(1 - \left(1 - \alpha\right)^{n}\right)$$ $$\pi \beta^{n} + \left(1 - \alpha\right)^{n} \left(1 - \pi\right)$$

Giving posterior probability of:

>>> post_prob_multi = multi_assoc['t_s'] / (multi_assoc['t_s'] + multi_assoc['f_s'])
>>> post_prob_multi
pi*(-beta**n + 1)/(pi*(-beta**n + 1) + (-pi + 1)*(-(-alpha + 1)**n + 1))

>>> # Formula from Ioannidis 2005:
>>> ppv_multi = R * (1 - beta ** n) / (R + 1 - (1 - alpha) ** n - R * beta ** n)
>>> # Is this the same as our formula above?
>>> simplify(ppv_multi - post_prob_multi) == 0
True

(png, hires.png, pdf)

# Putting it together¶

Considering analysis bias and positive publication bias together:

>>> multi_bias_assoc_noprior = dict(
...    t_s = (1 - beta ** n) + u * beta ** n,
...    t_ns = beta ** n - u * beta ** n,
...    f_s = 1 - (1 - alpha) ** n + u * (1 - alpha) ** n,
...    f_ns = (1 - alpha) ** n - u * (1 - alpha)**n)

 $$T_S$$ $$T_N$$ $$H_A$$ $$1 - \beta^{n} + u \beta^{n}$$ $$\beta^{n} - u \beta^{n}$$ $$H_0$$ $$1 - \left(1 - \alpha\right)^{n} + u \left(1 - \alpha\right)^{n}$$ $$\left(1 - \alpha\right)^{n} - u \left(1 - \alpha\right)^{n}$$ Total $$2 - \beta^{n} - \left(1 - \alpha\right)^{n} + u \beta^{n} + u \left(1 - \alpha\right)^{n}$$ $$\beta^{n} + \left(1 - \alpha\right)^{n} - u \beta^{n} - u \left(1 - \alpha\right)^{n}$$
>>> multi_bias_assoc = multi_bias_assoc_noprior.copy()
>>> multi_bias_assoc['t_s'] *= pi
>>> multi_bias_assoc['t_ns'] *= pi
>>> multi_bias_assoc['f_s'] *= 1 - pi
>>> multi_bias_assoc['f_ns'] *= 1 - pi

 $$T_S$$ $$T_N$$ $$H_A$$ $$\pi \left(1 - \beta^{n} + u \beta^{n}\right)$$ $$\pi \left(\beta^{n} - u \beta^{n}\right)$$ $$H_0$$ $$\left(1 - \pi\right) \left(1 - \left(1 - \alpha\right)^{n} + u \left(1 - \alpha\right)^{n}\right)$$ $$\left(1 - \pi\right) \left(\left(1 - \alpha\right)^{n} - u \left(1 - \alpha\right)^{n}\right)$$ Total $$\pi \left(1 - \beta^{n} + u \beta^{n}\right) + \left(1 - \pi\right) \left(1 - \left(1 - \alpha\right)^{n} + u \left(1 - \alpha\right)^{n}\right)$$ $$\pi \left(\beta^{n} - u \beta^{n}\right) + \left(1 - \pi\right) \left(\left(1 - \alpha\right)^{n} - u \left(1 - \alpha\right)^{n}\right)$$
>>> post_prob_multi_bias = (
...    multi_bias_assoc['t_s'] /
...    (multi_bias_assoc['t_s'] + multi_bias_assoc['f_s'])
...    )
>>> post_prob_multi_bias
pi*(beta**n*u - beta**n + 1)/(pi*(beta**n*u - beta**n + 1) + (-pi + 1)*(u*(-alpha + 1)**n - (-alpha + 1)**n + 1))

Now we make a numerical version of this symbolic expression, so we can evaluate it for different values of $$\alpha, \beta, \pi, u, n$$:

>>> # Make numerical version of symbolic expression
>>> pp_mb_func = lambdify((alpha, beta, pi, u, n), post_prob_multi_bias)

Let’s assume that two groups are doing more or less the same study, and only the positive study publishes ($$n = 2$$). There is an analysis bias of 10% ($$u= 0.1$$). We take the power from the Button et al estimate for neuroimaging studies = 0.08. Therefore $$\beta = 1 - 0.08 = 0.92$$:

• Button, Katherine S., John PA Ioannidis, Claire Mokrysz, Brian A. Nosek, Jonathan Flint, Emma SJ Robinson, and Marcus R. Munafò. 2013. “Power failure: why small sample size undermines the reliability of neuroscience.” Nature Reviews Neuroscience.

(png, hires.png, pdf)

This graph tells us that, for a study with average power in neuroimaging, with some mild analysis bias and positive publication bias, the significant finding $$T_S$$ does not change our posterior very much from our prior.

If we do some study with an hypothesis that is suitably unlikely apriori - say $$Pr(H_A) = 0.25$$ - then our posterior probability is:

>>> print(pp_mb_func(0.05, 0.92, 0.25, 0.1, 2))
0.2972463786...

What if the result was significant at $$p < 0.01$$?:

>>> print(pp_mb_func(0.01, 0.92, 0.25, 0.1, 2))
0.40245282700...

So, even if our result is significant at $$p < 0.01$$, the probability that $$H_A$$ is correct is still less than $$0.5$$.