search for: x_i

Displaying 20 results from an estimated 60 matches for "x_i".

Did you mean: __i
2013 Jun 23
1
2SLS / TSLS / SEM non-linear
Dear all, I try to conduct a SEM / two stage least squares regression with the following equations: First: X ~ IV1 + IV2 * Y Second: Y ~ a + b X therein, IV1 and IV2 are the two instruments I would like to use. the structure I would like to maintain as the model is derived from economic theory. My problem here is that I have trouble solving the equations to get the reduced form so I can
2013 Jul 02
0
Optimización MINLP
Muy buenas, Tengo la siguiente duda/problema, He optimizado con éxito un problema de este tipo: \sum f(x_i) donde f es una curva exponencial (función no lineal) sujeto a: a_i < x_i < b_i y \sum f(x_i) < Presupuesto Vamos, es repartir un presupuesto forzando a que inviertas como poco a_i y como mucho b_i para cada i Esto lo hecho correctamente usando el paquete: http://cran.r-proje...
2018 Jan 17
1
mgcv::gam is it possible to have a 'simple' product of 1-d smooths?
I am trying to test out several mgcv::gam models in a scalar-on-function regression analysis. The following is the 'hierarchy' of models I would like to test: (1) Y_i = a + integral[ X_i(t)*Beta(t) dt ] (2) Y_i = a + integral[ F{X_i(t)}*Beta(t) dt ] (3) Y_i = a + integral[ F{X_i(t),t} dt ] equivalents for discrete data might be: 1) Y_i = a + sum_t[ L_t * X_it * Beta_t ] (2) Y_i = a + sum_t[ L_t * F{X_it} * Beta_t ] (3) Y_i = a + sum_t[ L_t * F{X_it,t} ] where Y_i are sc...
2010 Dec 15
4
Generacion de binomiales correlacionadas
...iones de una distribucion binomial bivariada en la que hay _cierto_ grado de correlacion (denotemoslo rho). Podria por favor alguien indicarme como hacerlo en R? Este es el contexto. Supongamos que se tienen dos experimentos en los que la variable respuesta _sigue_ una distribucion binomial, i.e., X_i ~Binomial(n_i, p_i), i=1,2 y que, por ahora, n_i y p_i son conocidos. El interes principal es calcular T = P(X_1=1, X_2=1). Si las X_i''s fueran independientes (caso 1), seria suficiente generar binomiales con los parametros correspondientes a cada tipo de experimento (via rbinom) y calcul...
2009 Jan 15
1
logistic regression - exp(estimates)?
hello. I have a question on the interpretation of a logistic model. is it helpful to exponentiate the coefficients (estimates)? I think I once read something about that, but I cannot remember where. if so, how would be the interpretation of the exp(estimate) ? would there be a change of the interpretation of the ANOVA table (or is the ANOVA table not really helpful at all?). thanks for your
2005 Jun 10
1
Estimate of baseline hazard in survival
...e Hosmer and Lemeshow text on Applied Survival Analysis to that of the help that comes with the survival package. I am trying to back out the values for the baseline hazard, h_o(t_i), for each event time or observation time. Now survfit(fit)$surv gives me the value of the survival function, S(t_i|X_i,B), using mean values of the covariates and the coxph() object provides me with the estimate of the linear predictors, exp(X'B). If S(t_i|X_i,B)=S_o(t_i)^exp(X_iB) is the expression for the survival function And -ln(S_o(t_i) ) is the expression for the cumulative baseline hazard function, H_o(...
2018 Mar 15
3
stats 'dist' euclidean distance calculation
...: 3x3 subset used Locus1 Locus2 Locus3 Samp1 GG <NA> GG Samp2 AG CA GA Samp3 AG CA GG The euclidean distance function is defined as: sqrt(sum((x_i - y_i)^2)) My assumption was that the difference between x_i and y_i would be the number of allelic differences at each base pair site between samples. For example, the euclidean distance between Samp1 and Samp2 would be: euclidean distance = sqrt( S1_L1 - S2_L1)^2 + (S1_L2 - S2_L2)^2 + (S1_L3 - S...
2009 May 16
1
maxLik pakage
...maxLik" function #####the function in latex commands is as following:  \begin{eqnarray*} &&\ell(\xi,\omega,\nu,\lambda_1,\lambda_2)=n\log2-n\log\omega+n\log\Gamma(\frac{\nu+1}{2})-\frac{n}{2}\log(\nu\pi)\\ &-&n\log\Gamma(\frac{\nu}{2})-\frac{\nu+1}{2}\sum_{i=1}^{n}\log(1+\frac{(x_i-\xi)^2}{\omega^2\nu})+\sum_{i=1}^{n}\log\Phi(\lambda_1\frac{(x_i-\xi)}{\sqrt{\omega^2+\lambda_2(x_i-\xi)^2}}) \end{eqnarray*} ############## G2StNV178<-function(a){ require(maxLik) II=0 nu<-(a[1]) lambda1<-a[2] lambda2<-a[3] ksi<-a[4] omega<-a[5] II<-log(prod((2*dt((x-ksi)/...
2010 Feb 09
0
Kernel density / weights matrix?
...e very grateful or some advice regarding the Kernel density (apologies beforehand if my terminology is not fully correct). I have looked into ksmooth and npreg, but with no success. Given a (n x p) matrix of covariates X, I need to construct the following matrix of Kernel densities or weights: w(x_i, x_j) = K(x_i - x_j) ----------------------------- sum_{k=1}^n K(x_i - x_k) where x_i, x_j, x_k are (1 x p) vectors, and K is a multivariate normal kernel. The resulting weighting matrix W has dimension (n x n). I have looked into npreg, but if I get this correctly, it does not out...
2018 Mar 15
0
stats 'dist' euclidean distance calculation
...Locus1 Locus2 Locus3 > Samp1 GG <NA> GG > Samp2 AG CA GA > Samp3 AG CA GG > > The euclidean distance function is defined as: sqrt(sum((x_i - y_i)^2)) My > assumption was that the difference between x_i and y_i would be the number > of allelic differences at each base pair site between samples. Base R does not share your assumption, which (from a general purpose stats point of view) would be a completely outlandish interpretati...
2011 Jun 07
2
gam() (in mgcv) with multiple interactions
Hi! I'm learning mgcv, and reading Simon Wood's book on GAMs, as recommended to me earlier by some folks on this list. I've run into a question to which I can't find the answer in his book, so I'm hoping somebody here knows. My outcome variable is binary, so I'm doing a binomial fit with gam(). I have five independent variables, all continuous, all uniformly
2006 Jan 11
1
complex matrix manipulation question
I've done stuff like this before but it's been a while and I'm stuck. Suppose I have a matrix with one column x and another column y and both are numeric and let the row index of the matrix be i Starting at index i ( i would equal on the first iteration ) when the cumulative sum of x_i+1 - x_i is greater than W = some constant, I want to mark that spot in the row, call it i^* and sum all the values in y between i and i^* and put that value a third column z. Otherwise, the values in the indices of z between i and i^*-1 should be NA. Then, start at i^*+1 and do the same thin...
2013 Mar 11
3
How to obtain the original indices of elements after sorting
...l position of these ordered x_(i) in X, how can I do it? case 1: all values are unique x <- c( 3, 5, 4, 6) x.sort <- sort(x) # # I would like to obtain a vector (1, 3, 2, 4) which indicates that 3 in x is still the 1st element in x.sort, 5 is at the 3rd position in x.sort. etc. case 2: some x_i's have the same value x <- c(3, 3, 5, 5, 4, 4, 6, 6) I would like to obtain a vector as (1, 2, 5, 6, 3, 4, 7, 8) I do not want to use which and loop over the vector to do it since for a long vector it is not fast enough. Thank you for your suggestion. Best wishes, Jie
2007 Jun 28
0
maximum difference between two ECDF's
Hello, I have a vector of samples x of length N. Associated with each sample x_i is a certain weight w_i. All the weights are in another vector w of the same length N. I have another vector of samples y of length n (small n). All these samples have equal weights 1/n. The ECDF of these samples is defined as for example at http://en.wikipedia.org/wiki/Empi...
2017 Dec 04
2
ggtern and bquote...
...d' the same as 'ggplot2' is ..) sometimes expressions instead of calls are needed, i.e., expression(*) instead of just quote(*). However, I think Levent really meant what you'd get by expression(P[a]) ? @Levent: The clue is the need for valid R syntax, and indeed, as in LaTeX x_i often is the i-th element of x, the R syntax for indexing/subsetting is used here, i.e. x[i] for LaTeX x_i Last but not least, if Levent really needs bquote() [i.e. substitute()] then, a final as.expression(.) may be needed : identical(as.expression(quote(a == 1)), expr...
2011 Dec 05
3
iterative variable names
Hi, I'm trying to assign iterative names to variable, but all my attempts have failed. I have a loop, and for every iteration, I need to create a variable, and I'd like to name them iteratively, such as: for(i in 1:10) { x_i <- c(values) } I need it to return ten variables: x_1, x_2, ..., x_10 How can I do it? Thank you very much! Beatriz -- View this message in context: http://r.789695.n4.nabble.com/iterative-variable-names-tp4159888p4159888.html Sent from the R help mailing list archive at Nabble.c...
2010 Nov 15
1
interpretation of coefficients in survreg AND obtaining the hazard function
...change)? 2) My second question relates to the first. a) given a model from survreg, say mwa above, how should i do to extract the base hazard and the hazard of each patient given a set of predictors? With the hazard function for the ith individual in the study given by h_i(t) = exp(\beta'x_i)*\lambda*\gamma*t^{\gamma-1}, it doesn't look like to me that predict(mwa, type='linear') is \beta'x_i. b) since I need the coefficient intercept from the model to obtain the scale parameter to obtain the base hazard function as defined in Collett (h_0(t)=\lambda*\gamma*t^{\gamm...
2003 Aug 15
2
Oja median
...<- cbind(x[i, ], x[j, ]) y <- xx[, 1] * xx[, 4] - xx[, 2] * xx[, 3] z1 <- (xx[, 4] - xx[, 2]) z2 <- - (xx[, 3] - xx[, 1]) return(rq(y~cbind(z1, z2)-1)$coef) } To understand the strategy, note that the area of the triangle formed by the points x_i = (x_i1,x_i2), x_j = (x_j1,x_j2), and theta = (theta_1,theta_2) is given by the determinant, | 1 1 1 | Delta(x_i, x_j, theta) = .5 |y_i1 yj1 theta_1|. |y_i2 yj2 theta_2| Expanding the determinant in the unknown parameters...
2006 Feb 28
3
any more direct-search optimization method in R
Hello list, I am dealing with a noisy function (gradient,hessian not available) with simple boundary constraints (x_i>0). I've tried constrOptim() using nelder mead to minimize it but it is way too slow and the returned results are not satisfying. simulated annealing is so hard to tune and it always crashes R program in my case. I wonder if there are any packages or functions can do direct search optimi...
2017 Dec 04
1
YNT: ggtern and bquote...
...d' the same as 'ggplot2' is ..) sometimes expressions instead of calls are needed, i.e., expression(*) instead of just quote(*). However, I think Levent really meant what you'd get by expression(P[a]) ? @Levent: The clue is the need for valid R syntax, and indeed, as in LaTeX x_i often is the i-th element of x, the R syntax for indexing/subsetting is used here, i.e. x[i] for LaTeX x_i Last but not least, if Levent really needs bquote() [i.e. substitute()] then, a final as.expression(.) may be needed : identical(as.expression(quote(a == 1)),...