search for: jth

Displaying 20 results from an estimated 52 matches for "jth".

Did you mean: eth
2007 Nov 15
5
Multiply each column of array by vector component
Hi, I've got an array, say with i,jth entry = A_ij, and a vector, say with jth entry= v_j. I would like to multiply each column of the array by the corresponding vector component, i,e. find the array with i,jth entry A_ij * v_j This seems so basic but I can't figure out how to do it without a loop. Any suggestions? Michal.
2003 Apr 02
2
lme parameterization question
...to parameterize the following mixed model (following Piepho and Ogutu 2002), to test for a trend over time, using multiple sites: y[ij]=mu+b[j]+a[i]+w[j]*(beta +t[i])+c[ij] where: y[ij]= a response variable at site i and year j mu = fixed intercept Beta=fixed slope w[j]=constant representing the jth year (covariate) b[j]=random effect of jth year, iid N(0,sigma2[b]) a[i]=random effect of the ith site, iid N(0, sigma2[a]) t[i]=random effect of ith site, iid N(0, sigma2[t]) c[ij]=random error associated with ith site and jth year I would like to assume that an unstructured relationship applies...
2002 Dec 06
6
fast code
Hello, I have two vectors x1 and x2 both in increasing order. I want to select the x1[j]th entry which is the max min of the x2[i]th entry. I can do this using if and for statements but is there a quick way to do it without running a loop? Thank you in advance, Pantelis
2002 Sep 12
1
Problem with indexing
...e second contains the second row for each person from the original matrices etc etc up to the mth new set containing the mth row from the original matrices for each person. Say the original matrix for each person can be indexed by xfinal.list[[i]] I want to extract for each person in turn, the jth row, i.e. xfinal.list[[i]][j,] then bind these n vectors into a new matrix. I am a little confused as to how I can index the jth row from the ith person, obviously I will need a loop I thought I would be able to use something like: for (j in 1:m) { for (i in 1:n) { vector.list[[i,j]]<-xfin...
2010 Mar 04
2
smbclient queue and cancel commands not working
...2.7-11.4.1 but it's the same with Knoppix (6.2) samba-version 3.4.2 I searched the web for this but with no success (infos on the "server didn't supply a full spnego negprot" were related to general samba access errors which I don't have) any help is thankfully accepted cu jth
2012 May 09
1
reception of (Vegan) envfit analysis by manuscript reviewers
I'm getting lots of grief from reviewers about figures generated with the envfit function in the Vegan package. Has anyone else struggled to effectively explain this analysis? If so, can you share any helpful tips? The most recent comment I've gotten back: "What this shows is which NMDS axis separates the communities, not the relationship between the edaphic factor and the
2008 Mar 15
2
Please find the error in my code
...exact = TRUE) pw.test[i] <- (test2$p.value < 0.05) test3 <- ks.test(samp1, samp2,alternative = c("two.sided"), exact = TRUE) pks.test[i] <- (test3$p.value < 0.05) } pow.ttest[j] <- sum(pt.test)/sim.size # Calculate powers for jth setting pow.wtest[j] <- sum(pw.test)/sim.size pow.kstest[j] <- sum(pks.test)/sim.size } # End of j loop Error in pt.test[i] <- (test1$p.value < 0.05) : object "pt.test" not found Chat on a cool, new interface. No download required. Go to http://in.mess...
2006 Oct 02
1
multilevel factor model in lmer
...can be used to fit a multilevel factor model such as a two-parameter item response model. The one parameter model is straightforward. A two-factor model requires a set of factor loadings multiplying a single random effect. For example, a logit model for the ith subject responding correctly to the jth item (j=1,..,J) is logit[p(ij)] = a1*item1(i) + ... + aJ * itemJ(i) + lambda1*item1(i)*u(i) + ... + lambdaJ*itemJ(i)*u(i) where the lambdas are factor loadings, with lambda1 fixed to 1.0 and item1-itemJ are dummy variables for the items. Thanks, Dan =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-...
2007 Oct 29
1
How to test combined effects?
Suppose I have a mixed-effects model where yij is the jth sample for the ith subject: yij= beta0 + beta1(age) + beta2(age^2) + beta3(age^3) + beta4(IQ) + beta5(IQ^2) + beta6(age*IQ) + beta7(age^2*IQ) + beta8(age^3 *IQ) +random intercepti + eij In R how can I get an F test against the null hypothesis of beta6=beta7=beta8=0? In SAS I can run s...
2004 Nov 16
1
Pairwise Distances -- How to vectorize the loop
...ute pairwise distances among pairs of observations, which each pair containing data from 2 groups. There are more than 100000 unique pairs. I have programmed a distance function that has three parameters, a vector of covariates from the ith observation in Group 1, a vector of covarites from the jth observation in Group 2, and a weighting matrix. I have used expand.grid to create a matrix containing all possible pairs of Keys (unique identifiers) from Group 1 and Group 2 and a placeholder for each pairwise distance in an effort to pre-allocate memory. The data containing the covariates ar...
2010 Mar 07
2
smbget returns wrong exit code
smbget -Rr smb://localhost/share [all files and folders are copied successfully!] echo $? 1 On the other hand, when smbget is introduced with an error smbget -Rr smb://localhost/shar Can't open directory smb://localhost/shar: No such file or directory echo $? 0 This is breaking my error checking in backup scripts. I can't find any place to file a bug report, I hope this is the right
2012 Dec 06
1
Vectorizing integrate()
...- function(u) 1/ (1 + exp(- (B[1] + B[2] * (x[j] + u)))) * dnorm(u, 0, sd[j]) eta[j] <- integrate(fun, -Inf, Inf)$value } Here X is an n x p model matrix for the fixed effects, B is a vector with the estimates of the fixed effects at iteration t, x is a predictor variable in the jth row of X, and sd is a variable corresponding to x[j]. Is there a way this can be done without looping over the rows of X? Thanks, Harold [[alternative HTML version deleted]]
2007 Feb 28
1
Efficient way to repeat rows (or columns) of a matrix?
...f I have a vector, v_1, and another vector of positive integers, i_1, the same length as v_1, then rep(v_1,i_1) will repeat v_i[j] exactly i_1[j] times, like so: >rep(c(1,2,3),c(3,2,1)) [1] 1 1 1 2 2 3 > I'd like to do the same sort of thing where I replace v_1 with a matrix, and the jth row of the matrix is repeated i_1 times. Obviously, I could do this with for loops, like the following: >(ma1=matrix(1:6,nrow=2)) [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 >vr1=c(2,3) >rma1=NULL >for(i in 1:length(vr1)){for(j in 1:vr1[i]){rma1=rbind(rma1,ma1[i,])}} &...
2003 Dec 17
1
Accessing row and col names of SEXP objects
Can someone lend me a hand with extracting the dimnames from a SEXP? I've looked through R-exts, but I couldn't find an example. Here is the code I'm using to grab the jth column name and print it, but the colnames I'm getting are garbage. None of the following are working. void printInfo(SEXP ts) { int j; for (j=0; j<col; j++) { printf("%s\n",CHAR(STRING_ELT(GetColNames(ts), j))); printf("%s\n",CHAR(VECTOR_ELT(GetColNames(ts), j)))...
2005 Jun 15
2
need help on computing double summation
...t; 412 3 4 > 412 4 6 > 412 7 9 > 220 5 7 > 220 4 8 > 220 9 8 > ...... > Now I want to compute the following double summation: sum_{i=1}^k sum_{j=1}^{n_i}(x_{ij}-mean(x_i))*(y_{ij}-mean(y_i)) i is from 1 to k, indexing the ith subject id; and j is from 1 to n_i, indexing the jth observation for the ith subject. in the above expression, mean(x_i) is the mean of x values for the ith subject, mean(y_i) is the mean of y values for the ith subject. Is there a simple way to do this in R?
2010 May 04
1
All possible paths between two nodes in a flowgraph using igraphs?
...th from node i to j is any possible sequence of nodes from i to j which does not pass through any intermediate node more than once. - A first-order loop is any closed path in the flowgraph that returns to the initial node of the loop without passing through any intermediate node more than once. - A jth-order loop consists of j nontouching first-order loops. For example, in the flowgraph below http://n4.nabble.com/file/n2125321/flowgraph_subsume.jpg there are 18 paths between nodes 1 and a: - 1a; - 12a, 124a, 1243a, 1245a, 12436a, 124365a, 12456a, 124563a; - 13a, 134a, 136a, 1342a, 1345a, 13456a...
2013 Apr 01
1
Parameter Estimation in R with Sums and Lagged Variables
...i guys, I am afraid I am stuck with an estimation problem. I have two variables, X and Y. Y is explained by the weighted sum of n lagged values of X. My aim is to estimate the two parameters c(alpha0,alpha1) in: Yt = Sum from j=1 to n of ( ( alpha0 + alpha1 * j ) * Xt-j ) Where Xt-j denotes the jth lag of X. I came up with this approach because I thought it would be a good idea to estimate the slope of the weights rather than estimating one parameter for each lag of X added (I intent to set n very large). Is that easily doable in R? My first try looks like this: parameters<-function...
2008 Mar 08
1
Deleting rows satisfying a certain condition (sum of some colums>2)
I have a huge matrix and need to delete certain rows. What I need to do is: 1.In each row, calculate the sum of jth column and (J+2)th column 2. If the sum is greater than 2 then that row needs to be deleted. I have a sample matrix and my codes here. It does remove some rows but when it does, it skips the next row and each time it deletes a row, the dimension changes so it gets out of bound. I tried to fix thos...
2008 Mar 25
0
Mixed-effects models: question about the syntax to introduce interactions
...(Extending the Linear Model with R, Faraway 2005; and the R book, Crawley 2007), I am still not sure of the syntax to test my hypothesis. Thanks in advance for reading me. Briefly, I describe the data and the situation: I want to describe the age-specific fecundity of the ith individual from the jth replicate (or line) from the kth strain. Variables: Categorical factors: A[a] = Age (1,2,3 n=8) #Because the fecundity is not linear, I decided to include it in the model as a factor s[k] =strain (A and B, n=2) # for the moment two, but it?s likely to increase as the work progresses l[j] = lin...
2009 Dec 28
2
Modified R Code
...e2_min2  = 2.30 rate2_max2 = 2.65 rate2_min3  = 2.65 rate2_max3 = 2.99   If there are say 10 rates, then this will continue till   rate10_min1 =  ...... rate10_max1 = ...... ......... so on.   ## ________________________________________________________   # PROBLEM - B   # Suppose Rij = ith Rate and jth range. (There are 3 ranges i.e. j= 3).   data_label = expand.grid(c("R11", "R12", "R13"), c("R21", "R23", "R23"))   # gives the output like     data_label      Var1        Var2 1    R11         R21 2    R12         R21 3    R13         R21...