Displaying 20 results from an estimated 3000 matches similar to: "errors in help("TDist")?"
2019 May 16
3
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
Hi Hadley,
Thanks 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
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 still the 1st element in x.sort, 5 is at
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
2019 Jun 24
1
Calculation of e^{z^2/2} for a normal deviate z
>>>>> jing hua zhao
>>>>> on Mon, 24 Jun 2019 08:51:43 +0000 writes:
> Hi All,
> Thanks for all your comments which allows me to appreciate more of these in Python and R.
> I just came across the matrixStats package,
> ## EXAMPLE #1
> lx <- c(1000.01, 1000.02)
> y0 <- log(sum(exp(lx)))
> print(y0) ## Inf
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
2019 May 16
0
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
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
* ncol(rbind(x_1, x_2, ..., x_n)) equals m
Additionally, wouldn't you expect rbind(x_1[i], x_2[i]) to equal
rbind(x_1, x_2)[, i, drop = FALSE] ?
Hadley
On Thu, May 16, 2019 at 3:26 PM Gabriel Becker <gabembecker at
2007 Jun 11
1
Gini coefficient in R
If I use the Ineq library and the Gini 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
2006 Dec 19
3
Bug in rt() ? (PR#9422)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
<<insert bug report here>>
Reproduced on Debian and Windows ...
On 2.4.x if you execute
set.seed(12345)
t.1 <- rt(n = 1000, df = 20)
set.seed(12345)
t.2 <- rt(n = 1000, df = 20, ncp = 0)
all.equal(t.1, t.2) ## Not close to true
This appears to be due to the fact that in 2.4.x rt is now
rt
function (n, df, ncp = 0)
{
if
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
2008 Jun 14
1
qt with ncp>37.62
help(qt) states that:
"ncp non-centrality parameter delta; currently except for rt(), only for
abs(ncp) <= 37.62"
so I would expect that calling qt with non-centrality parameter exceeding
37.62 should fail, instead e.g. calling
> mapply(function(x) qt(p = 0.9, df = 55, ncp = x),35:45)
gives:
[1] 40.21448 41.35293 42.49164 43.68862 44.82945 45.97048 47.11170 48.25310
[9]
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
2019 May 17
1
nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
Hi Martin,
Thanks for chiming in. Responses inline.
On Fri, May 17, 2019 at 12:32 AM Martin Maechler <maechler at stat.math.ethz.ch>
wrote:
> >>>>> Gabriel Becker
> >>>>> on Thu, 16 May 2019 15:47:57 -0700 writes:
>
> > Hi Hadley,
> > Thanks for the counterpoint. Response below.
>
> > On Thu, May 16, 2019 at 1:59
2000 Nov 28
1
non-centrality parameter in pf() (PR#752)
Bug Description:
Problem with the function pf() when the non-centrality
parameter is large. Here is a sample command. You should
see a smooth line from 0 to about 55, and then the values
of pf() go crazy from 55 to 100.
############################
ncp <- seq(0,100,length=200)
plot(ncp,pf(5,7,2,ncp=ncp))
############################
Version:
platform = i686-pc-linux-gnu
arch = i686
os =
2002 Oct 17
3
Non-central distributions
Hi Folks,
I note that, while the "chisq" functions
dchisq(x, df, ncp=0, log = FALSE)
pchisq(q, df, ncp=0, lower.tail = TRUE, log.p = FALSE)
qchisq(p, df, ncp=0, lower.tail = TRUE, log.p = FALSE)
rchisq(n, df, ncp=0)
all have a slot for the non-centrality parameter "ncp", of
the functions for the t and F distributions:
dt(x, df, log = FALSE)
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" error in the line with the covariance.
2015 Feb 23
2
[Mesa-dev] [PATCH 2/2] nvc0/ir: improve precision of double RCP/RSQ results
Does this give correct results for special floats (0, infs)?
We tried to improve (for single floats) x86 rcp in llvmpipe with
newton-raphson, but unfortunately not being able to give correct results
for these two cases (without even more additional code) meant it got all
disabled in the end (you can still see that code in the driver) since
the problems are at least as bad as those due to bad
2006 Jul 01
1
noncentral F-distributed random numbers (PR#9055)
Full_Name: Long Qu
Version: 2.3.1
OS: Windows XP
Submission from: (NULL) (64.113.93.235)
The QQ-plot of two versions of simulating noncentral F-distributed random
numbers has quite different scales:
> qqplot(rf(1000,2,15,3),qf(runif(1000),2,15,3))
The rf() function reads:
> rf
function (n, df1, df2, ncp = 0)
{
if (ncp == 0)
.Internal(rf(n, df1, df2))
else rchisq(n, df1,
2011 Jun 19
2
please help! what are the different using log-link function and log transformation?
I'm new R-programming user, I need to use gam function.
y<-gam(a~s(b),family=gaussian(link=log),data)
y<-gam(loga~s(b), family =gaussian (link=identity),data)
why these two command results are different?
I guess these two command results are same, but actally these two command
results are different, Why?
--
View this message in context:
2006 Jan 06
1
vectorization of groups of dot products
I have a set of n vectors, x_1, ..., x_n, of the same length.
I would like to form the vector of dot products -- x_1'x_1, ..., x_n'x_n
the fastest way I can think to do this is to put the vectors into a
matrix
and do
diag(crossprod(X))
however, this seems to be very wasteful since this computes n(n+1)/2-n
unnecessary
dot products.
Is there a better way using existing functions in R?
2007 Mar 07
2
Power calculation for detecting linear trend
Dear people,
I've a problem in doing a power calculation. In Fryer and Nicholson
(1993), ICES J. mar. Sci. 50: 161-168 page 164 an example is given with
the following characteristics
T=5, points in time
R=5, replicates
Var.within=0.1
q=10, a 10% increase per year
The degrees of freedom for the test are calculated as Vl=T*R-2=23 and
the non-centrality parameter Dl=4.54.
Using this they get a