search for: x_

Displaying 20 results from an estimated 129 matches for "x_".

Did you mean: _x
2000 Apr 04
0
stochastic process transition probabilities estimation
Hi all, I'm new with R (and S), and relatively new to statistics (I'm a computer scientist), so I ask sorry in advance if my question is silly. My problem is this: I have a (sample of a) discrete time stochastic process {X_t} and I want to estimate Pr{ X_t | X_{t-l_1}, X_{t-l_2}, ..., X_{t-l_k} } where l_1, l_2, ..., l_k are some fixed time lags. It will be enough for me to compute #{ X_t=a_t, X_{t-l_1}=a_{t-l_1}, X_{t-l_2}=a_{t-l_2}, ..., X_{t-l_k}=a_{t-l_k} } ------------------------------------------------...
2015 Feb 03
2
Seed in 'parallel' vignette
Hi, This is most likely only a minor technicality, but I saw the following: On page 6 of the 'parallel' vignette (http://stat.ethz.ch/R-manual/R-devel/library/parallel/doc/parallel.pdf), the random-number generator "L'Ecuyer-CMRG" is said to have seed "(x_n, x_{n-1}, x_{n-2}, y_n, y_{n-1}, y_{n-2})". However, in L'Ecuyer et al. (2002), the seed is given with 'increasing' indices, so should rather be "(x_{n-2}, x_{n-1}, x_n, y_{n-2}, y_{n-1}, y_n)" (or, even more intuitively, "(x_{n-3}, x_{n-2}, x_{n-1}, y_{n-3}, y_{n-2...
2012 Jun 25
4
do.call or something instead of for
Dear R users, I'd like to compute X like below. X_{i,t} = 0.1*t + 2*X_{i,t-1} + W_{i,t} where W_{i,t} are from Uniform(0,2) and X_{i,0} = 1+5*W_{i,0} Of course, I can do this with "for" statement, but I don't think it's good idea because "i" and "t" are too big. So, my question is that Is there any bette...
2008 Apr 05
2
Adding a Matrix Exponentiation Operator
..., int nrows, int ncols, int mode) { for (int i=0; i < ncols; ++i) for (int j=0; j < nrows; ++j) REAL(b)[i * nrows + j] = REAL(a)[i * nrows + j]; } SEXP do_matexp(SEXP call, SEXP op, SEXP args, SEXP rho) { int nrows, ncols; SEXP matrix, tmp, dims, dims2; SEXP x, y, x_, x__; int i,j,e,mode; // Still need to fix full complex support mode = isComplex(CAR(args)) ? CPLXSXP : REALSXP; SETCAR(args, coerceVector(CAR(args), mode)); x = CAR(args); y = CADR(args); dims = getAttrib(x, R_DimSymbol); nrows = INTEGER(dims)[0]; ncols = INT...
2015 Mar 08
0
Seed in 'parallel' vignette
...t; This is most likely only a minor technicality, but I saw the > following: On page 6 of the 'parallel' vignette > (http://stat.ethz.ch/R-manual/R-devel/library/parallel/doc/parallel.pdf), > the random-number generator "L'Ecuyer-CMRG" is said to have seed > "(x_n, x_{n-1}, x_{n-2}, y_n, y_{n-1}, y_{n-2})". However, in L'Ecuyer > et al. (2002), the seed is given with 'increasing' indices, so should > rather be "(x_{n-2}, x_{n-1}, x_n, y_{n-2}, y_{n-1}, y_n)" (or, even > more intuitively, "(x_{n-3}, x_{n-2}, x_{n-1},...
2006 Sep 14
1
Rv generation
Hi, Can Someone inform me how to generate RV's using the below CDF, by inverse technique. Thanks for your help and time. My CDF is as follows \[ F(x)=0 \ \text{if} \ x < 0\]\[ F(x)=\{\frac{x-x_i}{x_{i+1}-x_{i}}*(p_{i+1}-p_{i})\}+p_{i}\ \forall \ x_{i}\leq x < x_{i+1} \] \[ F(x)=1 \ \text{if} \ x > x_{i+1} \] Regards Murthy
2013 Mar 11
3
How to obtain the original indices of elements after sorting
Dear All, Suppose I have a vector X = (x_1, x_2, ...., x_n), X_sort = sort(X) = (x_(1), x_(2), ... , x(n) ), and I would like to know the original 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 indicat...
2015 Jun 01
2
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...m `s` being NA, which is supported by the fact that summing over 'z' is costs half of 'y'. Now, I *cannot* reproduce the above using the following 'inline' example: > sum2 <- inline::cfunction(sig=c(x="double", narm="logical"), body=' double *x_ = REAL(x); int narm_ = asLogical(narm); int n = length(x); double sum = 0; for (R_xlen_t i = 0; i < n; i++) { if (!narm_ || !ISNAN(x_[i])) sum += x_[i]; } return ScalarReal(sum); ') > x <- rep(0, 1e8) > stopifnot(typeof(x) == "double") > system.time(sum2(x, na...
2012 Jul 28
4
quantreg Wald-Test
...R what I want it to do^^ My situation is as follows: I have a data set containing a (dependent) vector Y and the regressor X. My aim is to check whether the two variables do not granger-cause each other in quantiles. I started to compute via quantreg for a single tau:= q: rq(Y_t~Y_(t-1)+Y_(t-2)+...+X_(t-1)+X_(t-2)+...,tau=q) This gives me the quantile regression coefficients. Now I want to check whether all the coefficients of X are equal to zero (for this specific tau). Can I do this by applying rq.anova ? I have already asked a similiar question but I am not sure if anova is really calculatin...
2002 Sep 04
3
strange things with eval and parent frames
...fundamentally odd things are happening, as per below. Note BTW that this is NOT a classical scoping problem. Exactly the same things happen if I define subfunc1 etc. outside the body of test.parent.funcs. Second example: > test.parent.funcs2_ function() { subfunc3_ function() sys.call( -1) x_ subfunc3(); print( x) subfunc3a_ function() eval( quote( sys.call()), parent.frame()) x_ subfunc3a(); print( x) subfunc3b_ function() evalq( sys.call(), parent.frame()) x_ subfunc3b(); print( x) } > test.parent.funcs2() test.parent.funcs2() eval(expr, envir, enclos) eval(expr, env...
2005 Jun 01
2
Fitting ARMA model with known inputs.
Hello! Is it possible to use R time series to identificate a process which is subjected to known input? I.e. I have 2 sequences - one is measurements of black box's state and the second is the "force" by which this black box is driven (which is known too) and I want to fit thist two series with AR-process. The "ar" procedure from stats package expects that the force is
2006 Apr 08
1
cross product
Hi, there. How do I calculate the cross-product in the form of \sum_{i=1}^{n}X_{i}^{t} \Sigma X_{i} using R code without using do loop? X_{i} is the covariate matrix for subject I, \Sigma is the covariance matrix. Thanks for your help. Yulei [[alternative HTML version deleted]]
2017 Jun 05
2
Extensions of sip trunk
Hi, I just started with setting up a new asterisk system, that will operate on a sip trunk, but I wonder, how to transfer the calls to different extensions, because all calls appear as being send to the base number of the trunk. E.g. given the trunk range of 1234567800-12345678099, a call to 1234567800 is matched by the same pattern as a call to 12345678099. ; matches 12345678099, too exten
1999 Jul 28
1
skewness, kurtosis
...)) x75 <- as.double(quantile(x,prob=0.75)) qcsk <- (x25+x75-2*mean(x))/(x75-x25) qcsk } Finally a question which actually is not R-related (please excuse this misuse of the list): Is there something like a "quantile-coefficient of kurtosis"?? Maybe: k = (2b-a)/a with a = x_{p} - x_{1-p}, b = x_{q} - x_{1-q}, x_{} are quantiles, and p and q are chosen so that k=0 for the normal distribution. Thanks for help!! WK ---------------------------------------------------------- Wolfgang Koller, koller2 at fgr.wu-wien.ac.at Research Institute for European Affairs Vienna...
2013 Oct 21
2
Error de markdownToHTML al parsear LATEX
...tml los escribe como <sup> y <em> respectivamente. Estos símbolos no puedo simplemente reemplazarlos pues markdown los utiliza para indicar negrita y cursiva, por lo que se interpretan mal!. ¿Qué puedo hacer? Ejemplo de lo que ocurre: Fórmula escrita en el .md (Rstudio) " $x_{1},x^{2},\ldots x_{n}:\overline {x}=\dfrac {\sum _{i}x_{i}} {n}$" Línea del file generado por la función 'markdownToHTML': > lineas[218] [1] "<p>$$x<em>{1},x<sup>{2},\\ldots</sup> x</em>{n}:\\overline {x}=\\dfrac {\\sum <em>{i}x</em&g...
2015 Jun 01
0
sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...
...lob/trunk/src/nmath/nmath.h#L28-L33), whereas my sum2() code uses double. So using long double, I can reproduce the penalty of having NA_real_ with na.rm=FALSE; > sum3 <- inline::cfunction(sig=c(x="double", narm="logical"), body=' #define LDOUBLE long double double *x_ = REAL(x); int narm_ = asLogical(narm); int n = length(x); LDOUBLE sum = 0.0; for (R_xlen_t i = 0; i < n; i++) { if (!narm_ || !ISNAN(x_[i])) sum += x_[i]; } return ScalarReal((double)sum); ') > x <- rep(0, 1e8) > stopifnot(typeof(x) == "double") > system.time...
2011 Aug 01
3
formula used by R to compute the t-values in a linear regression
...near regression myself. Assuming that I have K variables, and N observations, the formula I am using is: For the k-th variable, t-value= b_k/sigma_k With b_k is the coefficient for the k-th variable, and sigma_k =(t(x) x )^(-1) _kk is its standard deviation. I find sigma_k = sigma * n/(n*Sum x_{k,i}^2 -(sum x_{k,i}^2)) With sigma: the estimated standard deviation of the residuals, Sigma = sqrt(1/(N-K-1)*Sum epsilon_i^2) With: N: number of observations K: number of variables This formula comes from my old course of econometrics. For some reason it doesn't match the t-value...
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
...oindent where $N$ indexes the total number of individuals, $K$ indexes the total number of items, $p(x|\theta,\beta)$ is the data likelihood and $f(\theta)$ is a population distribution. For the rasch model, the data likelihood is: \begin{equation} p(x|\theta,\beta) = \prod^N_{i=1}\prod^K_{j=1} \Pr(x_{ij} = 1 | \theta_i, \beta_j)^{x_{ij}} \left[1 - \Pr(X_{ij} = 1 | \theta_i, \beta_j)\right]^{(1-x_{ij})} \end{equation} \begin{equation} \label{rasch} \Pr(x_{ij} = 1 | \theta_i, \beta_j) = \frac{1}{1 + e^{-(\theta_i-\beta_j)}} \quad i = (1, \ldots, K); j = (1, \ldots, N) \end{equation} \noindent whe...
2006 Jan 25
1
xx-0.1.0 : xhtml and xml make it twice as dirty
...d be illegal </body> </html> <========< sample/b.rb >========> ~ > cat sample/b.rb require "xx" # # xml is as easy as html. xx extends your object very carefully, adding an # one method that is not prefaced with ''xx_'' : ''method_missing''. the # method_missing defined is conservatively, recognizing only methods that end # with underscore (''_'') as ''tag'' methods intended to generate markup. as with # html, attributes may be passed to a...
2007 Jul 06
1
algebra/moving average question - NOTHING TO DO WITH R
...ry bright people on this list. Suppose I had a time series of data and at each point in time t, I was calculating x bar + plus minus sigma where x bar was based on a moving window of size n and so was sigma. So, if I was at time t , then x bar t plus minus sigma_t would be based on the values of x_t-n+1 through x_t. This is the hard part : Is there a way to back out what the next value(s), x_t+1 would have to be in order to for that value to be either greater than x bar_t+1 plus Z*sigma_t+1 or less than x bar_t+1 plus minus Z*sigma_t+1. where Z is whatever constant ? I started to...