Hello everybody,
I am trying to compute the following double summation and am encountering
problems; I wonder if you can help?  Basically I have a matrix B of data
points (data frame?) and want to create a matrix g such that its (i,t) entry
is defined as follows:

g(i,t) = sum_{s = 1}^T
                 (Indicator function(n[t] = n[s]))
            sum_{j = 1}^{n[t]}
                 1/w*K( (B[i,t] - B[j,s]) / w)

where K is the kernel estimator, w is the bandwidth, and n is another
vector.  How would you go about this?  I tried something like

g <- matrix(0,N,T)

for (t in 1:T) {
for (i in 1:N) {
for (s in 1:T) {
 kern <- density(x = B[1:n[t],s], bw = "nrd0", kernel = "gaussian", weights
= NULL, n = T)
g[i,t] <- ghat[i,t] + (n[s] == n[t])*(kern$y[i])
 }
}
}

but R just freezes completely...

Sorry for lack of clarity; I'm very new to R...

Thank you very much!

--ML

	[[alternative HTML version deleted]]


