Displaying 8 results from an estimated 8 matches for "sum_j".
Did you mean:
sum_
2007 Feb 01
3
Help with efficient double sum of max (X_i, Y_i) (X & Y vectors)
...amer-von Mises type test statistic
which involves double sums of max(X_i,Y_j) where X and Y are vectors of
differing length.
I am currently using ifelse pointwise in a vector, but have a nagging
suspicion that there is a more efficient way to do this. Basically, I
require three sums:
sum1: \sum_i\sum_j max(X_i,X_j)
sum2: \sum_i\sum_j max(Y_i,Y_j)
sum3: \sum_i\sum_j max(X_i,Y_j)
Here is my current implementation - any pointers to more efficient
computation greatly appreciated.
nx <- length(x)
ny <- length(y)
sum1 <- 0
sum3 <- 0
for(i in 1:nx) {
sum1 <- sum1 + s...
2006 Dec 14
3
Model formula question
..._(j-1).
In order to estimate y-values, I'm assuming that delta j is
approximately equal to kj**u, such that my regression model should be
something like this:
^y_1 = a1
^y_2 = a1 + k2**u
^y_3 = a1 + k2**u + k3**u
...
^y_m = a1 + k2**u + k3**u + ... + km**u
or, generically
^yi = a1 + k * sum_j=2^i j**u
and I need to fit a non-linear least-squares regression model to find
the tripplet a1,k,u. I had a look to the gnm package, but I don't have
the lesser idea how to formulate this problem to use this package. Can
someone help me with that?
cheers,
Ronaldo
2012 Aug 16
1
sum over extremely small numbers
Dear All,
I am evaluating the value of loglikelihood and it ends up with the sum of
tiny numbers.
Below is an example: suppose I would like to calculate sum_i (log (sum_j x
[i, j] )), the index of log (x) is in the range, say (-2000, 0). I am aware
that exp(-744.5) will be expressed as 0 in 32 bit R and exp
Is there a way to improve the result?
R example:
powd <- sample(-2000:0, 100, replace=T) # the power of x [i, j]
x <- matrix(exp(powd),10)...
2012 Oct 27
0
[gam] [mgcv] Question in integrating a eiker-white "sandwich" VCV estimator into GAM
...e Ruppert et al textbook on
semiparametric regression uses GLS to account for correlated errors. I
haven't really used GLS much and I don't think it solves the
autocorrelation problem. I'm more accustomed to using a cluster-robust
"sandwich" estimator:
(X'X)^{-1} (sum_j(X_j' e_j e_j' X_j)) (X'X)^{-1}
In a penalized spline context, this would be something like the following:
(X'X+\lambda K)^{-1} (sum_j(X_j' e_j e_j' X_j)) (X'X+\lambda K)^{-1}
(where J are clusters -- units on whom observations are repeated).
As far as I can te...
2003 Jul 17
3
Looking to maximize a conditional likelihood
...j is the outcome (0 or 1) for the j'th
case in the i'th cluster It has vector covariates X_ij. c_ij is a
transform of y_ij and is in (0, 1) (it's actually the probability of
being in cluster j). It may be specified a priori or to be estimated.
Maximize the product over i of
c_ij exp(sum_j y_ij X_ij b)
----------------------------
sum_K c_ij exp(sum_K y_ij X_ij b)
Where sum_K means we are summing over all possible subsets of the strata
that contain the observed number of successes.
b, and perhaps c, are the parameters to estimate.
The more vanilla case has no c_ij terms. That says...
2006 Dec 14
0
Model formula
..._(j-1).
In order to estimate y-values, I'm assuming that delta j is
approximately equal to kj**u, such that my regression model should be
something like this:
^y_1 = a1
^y_2 = a1 + k2**u
^y_3 = a1 + k2**u + k3**u
...
^y_m = a1 + k2**u + k3**u + ... + km**u
or, generically
^yi = a1 + k * sum_j=2^i j**u
and I need to fit a non-linear least-squares regression model to find
the tripplet a1,k,u. I had a look to the gnm package, but I don't have
the lesser idea how to formulate this problem to use this package. Can
someone help me with that?
cheers,
Ronaldo
2006 Oct 16
2
Re : Re : Generate a random bistochastic matrix
Yes, you're right. In fact, it's just an adaptation of a matlab command and the author advises using N^4 replications that's why it's the default in the function. The bistochastic matrix is not my subject of interest, but I need it to perform some random tranformation of a vector of incomes.
Florent Bresson
----- Message d'origine ----
De : Richard M. Heiberger <rmh at
2006 Oct 16
5
Re : Generate a random bistochastic matrix
Thanks, I tried someting like this, but computation takes times for large matrices
btransf <- function(y,X=length(y)^4) {
N <- length(y)
bm <- matrix(rep(1/N,N^2),N,N)
for(j in 1:X){
coord <- sample(1:N,4,replace=T)
d <- runif(1,0,min(bm[coord[1],coord[2]],bm[coord[3],coord[4]]))