similar to: metaprogramming with lm

Displaying 20 results from an estimated 10000 matches similar to: "metaprogramming with lm"

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
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
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
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.
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
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
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
2005 Jun 15
2
need help on computing double summation
Dear helpers in this forum, This is a clarified version of my previous questions in this forum. I really need your generous help on this issue. > Suppose I have the following data set: > > id x y > 023 1 2 > 023 2 5 > 023 4 6 > 023 5 7 > 412 2 5 > 412 3 4 > 412 4 6 > 412 7 9 > 220 5 7 > 220 4 8 > 220 9 8 > ...... > Now I want to compute the
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
2012 Feb 03
1
How to use a sequence of covariates in linear model (lm)?
I have a high dimension linear model: y~ x1 + x2 + ... + x_n. n is very large. For linear model fit, I wish to use a sequence of covariates, say X1 to X200, without typing every single covariate in the function (my variable names are coded in the pattern of X1, X2, ...). I think all.var or all.names might have worked but I can't figure out how to do it. Please help. Thanks, Michael
2018 Mar 15
3
stats 'dist' euclidean distance calculation
Hello, I am working with a matrix of multilocus genotypes for ~180 individual snail samples, with substantial missing data. I am trying to calculate the pairwise genetic distance between individuals using the stats package 'dist' function, using euclidean distance. I took a subset of this dataset (3 samples x 3 loci) to test how euclidean distance is calculated: 3x3 subset used
2015 Feb 23
2
[PATCH 1/2] nv50/ir: add fp64 support on G200 (NVA0)
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- Untested beyond compiling a few shaders to see if they look like they might work. nvdisasm agrees with envydis's decoding of these things. Will definitely get ahold of a G200 to run tests on before pushing this. .../drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 94 ++++++++++++++++++---
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
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 R have any function
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
2004 Apr 18
2
lm with data=(means,sds,ns)
Hi Folks, I am dealing with data which have been presented as at each x_i, mean m_i of the y-values at x_i, sd s_i of the y-values at x_i number n_i of the y-values at x_i and I want to linearly regress y on x. There does not seem to be an option to 'lm' which can deal with such data directly, though the regression problem could be algebraically
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:
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
2006 Dec 20
2
Kalman Filter in Control situation.
I am looking for a Kalman filter that can handle a control input. I thought that l.SS was suitable however, I can'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