Good evening, all,
I have several questions about _Unifying Political Methodology_, ch. 4.
I read a few books, though I fail to find answers.
Does anybody know answer or give me reference?
p. 73, in the last equation
why does the second sigma^2 lack tilde?
p. 79., l. 5
what does
\stackrel{\nrightarrow}{p}
mean?
p. 79, 3rd paragragh, l.3
what is a scale factor?
p. 84, l. 7, 8
Aren't Eqs. (4.2) and (4.6) reversed?
According to p. 83, the third paragragh,
the restricted model under the alternative hypothesis is expressed in Eq. (4.2) and
the unrestricted model under the null hypothesis is expressed in Eq. (4.6) .
p. 86, l. 7
what is inverse probability?
Hi,
Even if I input ?plot at R prompt,
it only shows simple explanation of Zelig plot command,
not detailed one of R plot command
(for example, I fail to understand what "tcl" or "mgp" parameters mean in plot command).
How can I know the latter?
Kentaro
Hi, everyone.
Please do #2-#5 on this week's problem set first -- I need to
figure out exactly what the notation is for #1. A revision will
be posted shortly.
Yours,
Olivia
Hi,
Those of you who were on ice4 found that the server was behaving very
strangely on Thursday, which isn't a reason to stop using the servers
(they're still more reliable than your desktop), BUT you should do the
following in the future:
If you find that your XEmacs hangs and freezes, OR R kills itself, OR your
VNC session gets terminated for no apparent reason, you can log in to the
server you're working on and type:
ice1:olau~> top
This tells you who's running the process that's killing yours. There are
a couple columns that look like this:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28136 finkler 35 10 344m 62m 63m R 95.8 1.6 24:45.59 matlab
29442 olau 26 10 2792 1340 2460 R 3.7 0.0 0:00.06 top
There are three columns you should pay attention to:
* NI, which tells you if the process is niced (so it won't hog the
CPU) THIS MATTERS.
* %CPU, which tells yo how much of *one* CPU the process is using --
these numbers won't add up to 100% because there are two CPUs for each
ice1-4 machine. THIS DOESN'T MATTER, AS LONG AS THE PROCESS HAS NI >= 10.
So it looks like this finkler person is being bad because he's taking up
almost 100% of one CPU, but he's actually ok because his process has
NI=10.
* %MEM -- THIS IS THE IMPORTANT COLUMN. Memory (RAM) is fixed so if
there's a process that's taking up a significant amount of memory (like
50% plus) this puts a squeeze on the system and it has to hot-swap memory,
which makes everything go nuts and fail. (This is what happened on
Thursday.)
So in the future, if you find that the servers are behaving strangely, you
can use top to figure out why. And if it turns out that it's not your
process that's making trouble, you can figure out who is responsible, tell
me about it, and I will talk to FAS for you.
Yours,
Olivia.
Hi,
I'm afraid solution set 3(a) may be wrong, though I'm not sure.
In the fourth equation, matrix(c(
sigma^2_(z+w),
sigma_(z+w, z-w),
sigma_(z-w, z+w),
sigma^2_(z-w)),
nrow=2, ncol=2) is not Sigma but A%*%Sigma%*%t(A).
Since X=rbind(Z, W) and X ~ N (mu, Sigma),
Sigma is a matrix(c(sigma^2_z, sigma_(z, w), sigma_(w, z), sigma^2_w), nrow=2, ncol=2)
In the fifth equation, since, generally, sigma_(a, b)= sigma_(b, a), A%*%Sigma%*%t(A) is a matrix(c(
(sigma^2_z + sigma^2_w - 2*sigma_(z, w)),
(sigma^2_z - sigma^2_w),
(sigma^2_z - sigma^2_w),
(sigma^2_z + sigma^2_w + 2*sigma_(z, w))
), nrow=2, ncol=2).
Here, since sigma^2_z = sigma^2_w) = 1,
comparing the above different expressions of A%*%Sigma%*%t(A)[1,2] and [2,1],
A%*%Sigma%*%t(A) is an othnogonal matrix
and Cov(Z+W) = Cov(Z-W) = 0.
Therefore, Z+W and Z^W are independent.
In the sixth and seventh equations,
from the above different expressions of A%*%Sigma%*%t(A)[1,1] and [2,2],
Var(Z+W) = Var(Z) + Var(W) + 2*Cov (Z, W)
Var(Z-W) = Var(Z) + Var(W) - 2*Cov (Z, W)
Hence, sigma^2_(z+w) is not equal to sigma^2_(z-w)).
How about this?
Kentaro
So normally, you multiply one thing by another thing by another
thing to
get the frequency distribution. So let's say it looks like:
a * b* c
But this number is really really big. So R (like any other
computer or
calculator), rounds the number using scientific notation to
either 8 or 16
significant digits. This creates a condition known as numerical
*in*stability. To get numerical *stability*, you instead add up
the log
terms and then exponentiate them at the end.
exp(ln(a) + ln(b) + ln(c)) ## This isn't R code -- but a
math.
So for the negative binomial model, when you calculate the
probability
density in each cell, you should (but don't need to) sum the log
terms
rather than just multiplying them.
----- Original Message -----
From: "Kate Emans" <emans(a)fas.harvard.edu>
To: "olivia Lau" <olau(a)fas.harvard.edu>
Sent: Monday, October 11, 2004 2:49 PM
Subject: questions on PS 3
> Hi Olivia,
> Hope you had a good weekend. Can you clarify for which part
> of #2 are we supposed to use the summation of log terms for
> the Negative Binomial? Is this totally essential? It is not
> explained in the notes anywhere so while I have some idea of
> what you mean, this is confusing.
>
> :) Kate
>
Hi all,
I mistakenly redefined the built-in constants, pi;
pi <- 0.3
How can I reset it to the original number,
the ratio of the circumference of a circle to its diameter?
Kentaro
In point a) of the assignemnt are you asking for the JOINT probability
distribution (obtained by simply multiplying the density functions for Gamma
and Poisson) or for the MARGINAL?
In the handout the two are confused, as the first formula in both lines 3.1 and
3.2 refer to the JOINT distribution, but then the second line refers to the
MARGINAL (the notation is wrong).
Thanks,
Simona.
Hi,
Old questions.
Assignment 1, 2(c) Confidence Interval
Should we compare empirical 2.5% and 97.5% quantile
with those caluclated using t-distribution?
What is "appropriate" coverage?
Assignment 2, 6 Beta Binominal, reparametarization
Why alpha <- mu/gamma?
According to Gary's lecture note, p. 48,.
mu <- a/(a+b)
gamma*mu <- ab/((a+b)^2)(a+b+1))
Then, gamma <- b/((a+b)(a+b+1))
mu/gamma=a(a+b+1))/b, not a...?
Kentaro
1) Set up a grid as we discussed in section.
2) Compute the joint density for each cell.
3) Sum over either the column or the row, depending on which one
corresponds to which parameter.
4) Plot the density of the marginal distribution.
----- Original Message -----
From: "Cecilia Vidal" <cvidal(a)camail.harvard.edu>
To: <gov2001-l(a)lists.fas.harvard.edu>
Sent: Friday, October 08, 2004 4:11 PM
Subject: RE: [gov2001-l] numerical integration in R
> Hi Olivia,
> Could you please give us more information about the "grid method" to solve
> question 2c in the assignment. You briefly mentioned it in yesterday's
> section but for some of us (and I'm talking on behalf of my study group)
> the
> intuition is not clear, not to mention how to program it in R, which is a
> different problem. Otherwise, please give us some references to
> investigate
> on our own.
> Thanks,
> Cecilia
>
>
> -----Original Message-----
> From: gov2001-l-bounces(a)lists.fas.harvard.edu
> [mailto:gov2001-l-bounces@lists.fas.harvard.edu]On Behalf Of Olivia Lau
> Sent: Friday, October 08, 2004 2:41 PM
> To: gov2001-l(a)lists.fas.harvard.edu
> Subject: Re: [gov2001-l] numerical integration in R
>
>
> The point is that there's no command. You have to program it and we went
> over how to do it in section.
>
> ----- Original Message -----
> From: "Simona Bignami" <sbignami(a)camail.harvard.edu>
> To: <gov2001-l(a)lists.fas.harvard.edu>
> Sent: Friday, October 08, 2004 9:05 AM
> Subject: [gov2001-l] numerical integration in R
>
>
>> What is the command to do numerical integration via the grid method in R?
>>
>> Thanks,
>> Simona.
>> _______________________________________________
>> gov2001-l mailing list
>> gov2001-l(a)lists.fas.harvard.edu
>> http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
>>
>
> _______________________________________________
> gov2001-l mailing list
> gov2001-l(a)lists.fas.harvard.edu
> http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
>
>