Displaying 20 results from an estimated 40 matches for "x_n".
Did you mean:
_n
2018 Mar 09
3
Contar categorías después de ciertos valores
Hola,
Estoy intentando averiguar cómo contar el número de categorías situadas después de ciertos valores. Por ejemplo, en el siguiente vector:
x <- c(3, "A", "B", 5, "A", 4, 5, "A", "A", 3)
el resultado que quisiera obtener es:
Valor -> Resultado
3 -> 1 A y 1 B
4 -> 0 A y 0 B
5 -> 3 A y 0 B
¿Alguien tiene alguna
2004 Mar 16
3
multiple summation
Hello,
I have to compute a multiple summation (not an integration because the
independent variables a
are discrete) for all the values of a function of several variables f
(x_1,...,x_n), that is
sum ... sum f(x_1,...,x_n)
x_1 x_n
have you some suggestion? Is it possible?
I know that for multiple integration there is the function adapt, but it has at
most n=20. In my case n depends on the dimension of the dataset and, hence, it
could be bigger.
Thank you,
Paolo
2019 Jun 24
1
Calculation of e^{z^2/2} for a normal deviate z
...a )
{Yes, this GPL-2 licenced {with Copyright, see file, please
keep this one line}
## Copyright (C) 2012 Marius Hofert, Ivan Kojadinovic, Martin Maechler, and Jun Y
}
----------------------------------------------------------------------
##' Properly compute log(x_1 + .. + x_n) for a given (n x d)-matrix of n row
##' vectors log(x_1),..,log(x_n) (each of dimension d)
##' Here, x_i > 0 for all i
##' @title Properly compute the logarithm of a sum
##' @param lx (n,d)-matrix containing the row vectors log(x_1),..,log(x_n)
##' each of dimension...
2015 Feb 23
2
[Mesa-dev] [PATCH 2/2] nvc0/ir: improve precision of double RCP/RSQ results
....
> bld.setPosition(i, true);
> - bld.mkOp2(OP_MERGE, TYPE_U64, def, dst[0], dst[1]);
> + guess = bld.mkOp2v(OP_MERGE, TYPE_U64, bld.getSSA(8), dst[0], dst[1]);
> +
> + // 5. Perform 2 Newton-Raphson steps
> + if (i->op == OP_RCP) {
> + // RCP: x_{n+1} = 2 * x_n - input * x_n^2
> + Value *two = bld.getSSA(8);
> +
> + bld.mkCvt(OP_CVT, TYPE_F64, two, TYPE_F32, bld.loadImm(NULL, 2.0f));
> +
> + guess = bld.mkOp2v(OP_SUB, TYPE_F64, bld.getSSA(8),
> + bld.mkOp2v(OP_MUL, TYPE_F64, bld.getSSA(8), two, gues...
2015 Feb 23
2
[PATCH 1/2] nv50/ir: add fp64 support on G200 (NVA0)
....getSSA(8), *neg = bld.getSSA(8), *copy = bld.getSSA(8);
+
+ bld.mkCvt(OP_CVT, TYPE_F64, two, TYPE_F32, bld.loadImm(NULL, 2.0f));
+
+ /* Square the guess first, since it was for RSQ */
+ guess = bld.mkOp2v(OP_MUL, TYPE_F64, bld.getSSA(8), guess, guess);
+
+ // RCP: x_{n+1} = 2 * x_n - input * x_n^2
+ guess = bld.mkOp2v(OP_SUB, TYPE_F64, bld.getSSA(8),
+ bld.mkOp2v(OP_MUL, TYPE_F64, bld.getSSA(8), two, guess),
+ bld.mkOp2v(OP_MUL, TYPE_F64, bld.getSSA(8), abs,
+ bld.mkOp2v(OP_MUL, TYPE_F64,...
2015 Feb 23
0
[PATCH 2/2] nvc0/ir: improve precision of double RCP/RSQ results
...back into the original destination.
bld.setPosition(i, true);
- bld.mkOp2(OP_MERGE, TYPE_U64, def, dst[0], dst[1]);
+ guess = bld.mkOp2v(OP_MERGE, TYPE_U64, bld.getSSA(8), dst[0], dst[1]);
+
+ // 5. Perform 2 Newton-Raphson steps
+ if (i->op == OP_RCP) {
+ // RCP: x_{n+1} = 2 * x_n - input * x_n^2
+ Value *two = bld.getSSA(8);
+
+ bld.mkCvt(OP_CVT, TYPE_F64, two, TYPE_F32, bld.loadImm(NULL, 2.0f));
+
+ guess = bld.mkOp2v(OP_SUB, TYPE_F64, bld.getSSA(8),
+ bld.mkOp2v(OP_MUL, TYPE_F64, bld.getSSA(8), two, guess),
+...
2019 May 16
3
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
...hanks for the counterpoint. Response below.
On Thu, May 16, 2019 at 1:59 PM Hadley Wickham <h.wickham at gmail.com> wrote:
> The existing behaviour seems inutitive to me. I would consider these
> invariants for n vector x_i's each with size m:
>
> * nrow(rbind(x_1, x_2, ..., x_n)) equals n
>
Personally, no I wouldn't. I would consider m==0 a degenerate case, where
there is no data, but I personally find matrices (or data.frames) with rows
but no columns a very strange concept. The converse is not true, I
understand the utility of columns but no rows, particularly i...
2015 Feb 23
0
[Mesa-dev] [PATCH 2/2] nvc0/ir: improve precision of double RCP/RSQ results
...on(i, true);
>> - bld.mkOp2(OP_MERGE, TYPE_U64, def, dst[0], dst[1]);
>> + guess = bld.mkOp2v(OP_MERGE, TYPE_U64, bld.getSSA(8), dst[0], dst[1]);
>> +
>> + // 5. Perform 2 Newton-Raphson steps
>> + if (i->op == OP_RCP) {
>> + // RCP: x_{n+1} = 2 * x_n - input * x_n^2
>> + Value *two = bld.getSSA(8);
>> +
>> + bld.mkCvt(OP_CVT, TYPE_F64, two, TYPE_F32, bld.loadImm(NULL, 2.0f));
>> +
>> + guess = bld.mkOp2v(OP_SUB, TYPE_F64, bld.getSSA(8),
>> + bld.mkOp2v(OP_MUL, TYPE_F64,...
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}...
2007 Jun 11
1
Gini coefficient in R
...i function in this way:
>Gini(c(100,0,0,0))
I obtain the result 0.75 instead of 1 (that is the perfect inequality).
I think Gini's formula in Ineq is based on a formula as reported here:
http://mathworld.wolfram.com/GiniCoefficient.html
but in the case of perfect inequality:
x_1=.......=x_n-1 =0
x_n>0
these formula are equal to 1 - 1/n, not to 1.
....I don't know where I'm wrong....
--
Michele De Meo
http://micheledemeo.blogspot.com/
[[alternative HTML version deleted]]
2011 May 23
1
help on permutation/randomization test
Hi,
I have two groups of data of different size:
group A: x1, x2, ...., x_n;
group B: y1, y2, ...., y_m; (m is not equal to n)
The two groups are independent but observations within each group are
not independent,
i.e., x1, x2, ..., x_n are not independent; but x's are independent from y's
I wonder if randomization test is still applicable to this case. Does...
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 indicates that 3
in x is s...
2008 Nov 13
3
metaprogramming with lm
Hello,
Say I want to make a multiple regression model with the following expression:
lm(y~x1 + x2 + x3 + ... + x_n,data=mydata)
It gets boring to type in the whole independent variables, in this
case x_i. Is there any simple way to do the metaprogramming for this?
(There are different cases where the names of the independent
variables might sometimes have apparent patterns or not)
2019 Jun 24
2
Calculation of e^{z^2/2} for a normal deviate z
>>>>> William Dunlap via R-devel
>>>>> on Sun, 23 Jun 2019 10:34:47 -0700 writes:
>>>>> William Dunlap via R-devel
>>>>> on Sun, 23 Jun 2019 10:34:47 -0700 writes:
> include/Rmath.h declares a set of 'logspace' functions for use at the C
> level. I don't think there are core R functions that call
2024 Jul 10
1
Implementation for selecting lag of a lag window spectral estimator using generalized cross validation (using deviance)
Dear All,
I am looking for:
A software to select the lag length for a lag window spectral estimator.
Also, I have a small query in the reprex given below.
Background for the above, from the book by Percival and Walden:
1. We are given X_1,...,X_n which is one realization of a stochastic process.
2. We may compute the periodogram using FFT, for example by the
function spectrum in R.
3. The above is badly biased so we taper X_1,...,X_n to reduce the
bias in the periodogram.
4. Now that the bias in under control, we focus on reducing the
varia...
2008 Nov 01
2
sampling from Laplace-Normal
Hi,
I have to draw samples from an asymmetric-Laplace-Normal distribution:
f(u|y, x, beta, phi, sigma, tau) \propto exp( - sum( ( abs(lo) +
(2*tau-1)*lo )/(2*sigma) ) - 0.5/phi*u^2), where lo = (y - x*beta) and
y=(y_1, ..., y_n), x=(x_1, ..., x_n)
-- sorry for this huge formula --
A WinBUGS Gibbs sampler and the HI package arms sampler were used with the
same initial data for all parameters. I compared the mean from both the
Gibbs sample and the arms sample for several y and x. Surprisingly, both
means always differed by the same constant....
2019 May 16
5
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
Hi all,
Apologies if this has been asked before (a quick google didn't find it for
me),and I know this is a case of behaving as documented but its so
unintuitive (to me at least) that I figured I'd bring it up here anyway. I
figure its probably going to not be changed, but I'm happy to submit a
patch if this is something R-core feels can/should change.
So I recently got bitten by
2006 Dec 20
2
Kalman Filter in Control situation.
...n't get it to work, and wonder if I am
not using the right function. What I want is a Kalman filter that accepts
exogenous inputs where the input is found using the algebraic Ricatti
equation solution to a penalty function. If K is the gain matrix then the
exogenous input would be u_t = -Kx_n, where x_n is the Kalman filter state
estimate. These inputs would be entered as such x_t = Ax_t-1 + Bu_t-1 +
Ge_t. Is l.SS in the dse1 package the correct parametrization of the Kalman
filter?
Thank you very much,
Todd Remund
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}, y...
2010 Nov 03
1
Orthogonalization with different inner products
Suppose one wanted to consider random variables X_1,...X_n and from each subtract off the piece which is correlated with the previous variables in the list. i.e. make new variables Z_i so that Z_1=X_1 and Z_i=X_i-cov(X_i,Z_1)Z_1/var(Z_1)-...- cov(X_i,Z__{i-1})Z__{i-1}/var(Z_{i-1}) I have code to do this but I keep getting a "non-conformable array&quo...