Hi all,
does anyone know how to do this without
using a loop?
I have a 9000 by 60 matrix and want to
do the following. For each element in
column x, I want to check if it is
missing, and if it is, I want to
substitute the corresponding element of
column y.
Thanks,
Holger
--
Holger Lutz Kern
Graduate Student
Department of Government
Cornell University
Institute for Quantitative Social Science
Harvard University
1737 Cambridge Street N350
Cambridge, MA 02138
www.people.cornell.edu/pages/hlk23
Along with Chapter 5 from "Unifying Political Methodology," this week's
assigned reading is King, Tomz, and Wittenberg 2000, available here:
http://gking.harvard.edu/files/making.pdf
A link is also posted on the course webpage under "handouts."
Best,
Dan
----
Ph.D. Student
Department of Government
Harvard University
Tutor, Currier House
dhopkins(a)fas.harvard.edu
http://www.danhopkins.org
I hope this is not considered an abuse of the class list.
Most summers I hire one or two people as "summer interns." These have
usually been graduate students in some analytical field. People in this
class would have the right skills, though perhaps not the right interests.
The data we analyze is typically marketing related. Examples include
forecasting how many active subscribers an ISP or phone company will have
each day for the next two years; Figuring out which towns should be grouped
together for the Boston Globe's local content editions; and selecting good
places for an insurance company to open new offices. In addition to data
analysis there would probably be work developing and debugging exercises for
a series of 3-day classes we are developing and perhaps some general-purpose
data preparation and programming.
This being the business world, knowledge of the tools our clients use such
as SAS and SQL would be better than R and LaTex, but this is not a big
concern. Our office is in the North End close to North Station and the
Haymarket stop of the Orange and Green lines.
See www.data-miners.com <http://www.data-miners.com/> for more information.
If interested, please be careful to respond only to me
(mjab(a)data-miners.com) so as not to bother the whole list.
-Michael
===============
Michael J. A. Berry
Data Miners, Inc.
+1 617 742 4252
When I run the optimization problem in question 3 optim gives me 4 of
the following warnings:
1: NaNs produced in: log(x)
the results seem to make sense nevertheless... can I trust them
anyways or do I have to try to keep optim from drifting into NAN areas?
thomas
Do you want us to get and use the log-likelihood function with lambda, or
do you want us to use x_i beta?
I'd assume the latter but 2.2 explicitly says lambda. It doesn't really
matter I guess.
-Lucy
Hi,
Regardless of the ranges for the axis I specify, my contour plot for
proble 3 draws lines only in the square of base [0,1] and height [0,1].
This is so with and wihout transforming the parameters. And the
transformation only bounds them from below so the artificial upper limit
my plot is creating doesn't make sense.
Any idea what is going on?
Juan
Hi All,
Just a quick note: for Problems 3.4 and 3.5 on Assignment 4, use the same
vector of datapoints as in problem 2.5.
Best,
Dan
----
Ph.D. Student
Department of Government
Harvard University
Tutor, Currier House
dhopkins(a)fas.harvard.edu
http://www.danhopkins.org
Hi All,
For the 6 PM section and the viewers at home, just a quick and minor
correction: when talking about the Hessian--the matrix of second partial
derivatives--the expression I put on the board during section wasn't quite
right. It should have been the second partial derivative *of the
log-likelihood* with respect to the parameter/parameters. The take-home
point remains the same, and is simply this: the Hessian lets us measure
the curvature of the log-likelihood function at its maximum with respect
to each of the parameters. After a few manipulations which are presented
in the Section handout under "Bonus: Uncertainty", the Hessian can be made
into a standard error for the maximum likelihood estimate of the
parameter.
Best,
Dan
----
Ph.D. Student
Department of Government
Harvard University
Tutor, Currier House
dhopkins(a)fas.harvard.edu
http://www.danhopkins.org
Hi Yuki,
I am responding to the list, since others might have the same questions.
Here is the key, take-home point: *The best example of what we want when
we ask for the specification of the model is found on the top of slide 18
of the lecture notes entitled "Inference."* There, Gary lays out the
statement of the model in the stylized normal case. We want the same
thing in this problem set for the models we specify.
To answer the specific questions:
1) Yes, y is a vector with n elements.
2) You are right: the equation for the Poisson comes from those first
principles, so you do *not* need to include any of the first principles in
your statement of the model. Just the systematic component, the
stochastic component, and other information to specify the model.
3) I'm not sure I quite follow, but don't think you need to mention that.
Best,
Dan
On Fri, 10 Mar 2006, Yuki Takagi wrote:
> Hi Dan and Ian,
>
> I'd like to ask you about three questions.
>
> First, do you mean by "over all n observations indexed i" that y is a vector
> which has n elements?
>
> Second, what do you mean by "not formalized by those components"? I came up
> with six assumptions as follows. However, I don't know which is the
> assumption "not formalized by those components". Since the equation of the
> poisson distribution consists of those assumptions, I feel that any
> assumptions may be formalized by the equation.
> 1) Y_i is a descrete, countably infinite on the nonnegative integer.
> 2) We cannot observe the underloying data generation process, but only its
> consequences (the total count of events).
>
> 3) More than one event cannot occur at precisely the same instant
> 4) The probability of occurring in one time is constant and independent of
> all previous events (lambda is constant over i)
> 5) Zero events have occurred at the start of each period.
> 6) The length of each observation period i is identical.
>
> Third, I think lambda is constant not only over all n observations but also
> over all ovservations. I mean, over (y_1, ...., y_n), (y'_1, ..., y'_n),
> (y''_1, ..., y''_n), ..... Do I have to menthion this?
>
> Thanks a lot
> Yuki
>