[R] tsmp::find_discord help

2021-11-20 Thread David Katz via R-help
ndow_size) : ## 'window_size' must be at least 2. > *David Katz*, TIBCO Data Science 1.541.324.7417 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/m

[R] tsmp::find_discord failure

2021-11-20 Thread David Katz via R-help
e queries are different. ## Error in fast_avg_sd(data, window_size) : ## 'window_size' must be at least 2. > *David Katz*, TIBCO Data Science 1.541.324.7417 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] problem using tsmp::find_discord

2021-11-20 Thread David Katz via R-help
ing in dist_profile(data, data, nn, window_size = .mp$w, index = discord_idx) : ## Warning: Result may be inconsistent if the size of the queries are different. ## Error in fast_avg_sd(data, window_size) : ## 'window_size' must be at least 2. *David Katz*, TIBCO Data Science 1.541.32

[R] gbm question

2016-11-21 Thread David Katz via R-help
fference: 0.3585409" #all.equal(gbm.formula,gbm.Fit) no! (Based on the package examples) Thanks *David Katz*| IAG, TIBCO Spotfire [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] FlexBayes installation from R-Forge Problem R 3.2.2

2015-09-28 Thread David Katz
Pascal, Oops. Thanks! *David Katz*| IAG, TIBCO Spotfire O: 1.541.203.7084 | M: 1.541.324.7417 On Mon, Sep 28, 2015 at 5:47 PM, Pascal Oettli wrote: > You misspelled the web address. It is "R-project", not "R.project". > Thus, the command line should be: >

[R] mgcv::gam in splus?

2012-04-10 Thread David Katz
Is mgcv and particularly its gam available for Splus? I've been using it happily in R and need to implement something in Splus for which the automatic smoothing parameter selection is needed. Thanks for any guidance, David Katz da...@davidkatzconsulting.com -- View this message in co

Re: [R] Question about glmnet

2011-05-12 Thread David Katz
I believe you can in this sense: use model.matrix to create X for glmnet(X,y,...). However, when dropping variables this will drop the indicators individually, not per factor, which may not be what you are looking for. Good luck, David Katz Axel Urbiz wrote: > > Hi, > > Is it

Re: [R] list concatenation

2011-01-11 Thread David Katz
ne is not composed of lists and then concatenates. If the structure of the lists does not agree, this will fail. Regards, David Katz da...@davidkatzconsulting.com -- View this message in context: http://r.789695.n4.nabble.com/list-concatenation-tp3209182p3209324.html Sent from the R help maili

Re: [R] creating a list of dataframes

2010-12-03 Thread David Katz
1) You have redefined the command list which creates lists - not a great idea. 2) See lapply; for example. Try something like: list.of.df <- lapply(list.of.filenames,read.csv) list.of.results <- lapply(list.of.df,your.application.function) Regards, David -- View this message in context: http:

Re: [R] the first. from SAS in R

2010-11-24 Thread David Katz
Often the purpose of first/last in sas is to facilitate grouping of observations in a sequential algorithm. This purpose is better served in R by using vectorized methods like those in package plyr. Also, note that first/last has different meanings in the context of "by x;" versus "by x notsorted

[R] Identifying integers (as opposed to real #s) in matrix

2010-08-10 Thread David Katz
-222. Ultimately, I'm going to replace the values in the integer-only rows with "NAs." But first I need r to recognize the integer-only rows. I assume whatever function I write will be keyed off of the ".s", but have no clue how to write that function

Re: [R] subset function unexpected behavior

2010-02-02 Thread David Katz
ch == s)) } [1] 1 sch pop 1 1 100 2 1 200 [1] 2 sch pop 3 2 300 4 2 400 Don't confound the 'sch' variable in your data frame with the index in your loop :) HTH, Dennis On Mon, Feb 1, 2010 at 8:17 PM, David Katz <[hidden email]>wrote: - Hide quoted

[R] subset function unexpected behavior

2010-02-02 Thread David Katz
I was surprised to see this unexpected behavior of subset in a for loop. I looked in subset.data.frame and it seemed to me that both versions should work, since the subset call should be evaluated in the global environment - but perhaps I don't understand environments well enough. Can someone enli

[R] Windows Graphics Device Lockups with Rterm

2009-07-10 Thread David Katz
I've been using Rterm with ESS to run R for some time. Recently I've experienced lockups when displaying graphics; the first display seems to work, but then refuses to respond and must be killed with dev.off(). Rgui has no problems. I've tried eliminating all other processes that might cause confl

[R] www.rpad.org

2009-06-23 Thread David Katz
I've noticed this website has been down for several days. Does anyone have any information on whether/when it is coming back? Thanks. -- View this message in context: http://www.nabble.com/www.rpad.org-tp24175392p24175392.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] how to subsample all possible combinations of n species taken 1:n at a time?

2009-04-06 Thread David Katz
24079278 > 33282839 12751862 26086726 31363494 7118320 21866536 4212929 > David Katz www.davidkatzconsulting.com -- View this message in context: http://www.nabble.com/how-to-subsample-all-possible-combinations-of-n-species-taken-1%3An-at-a-time--tp22911399p22919597.html Sent from th

Re: [R] how to subsample all possible combinations of n species taken 1:n at a time?

2009-04-06 Thread David Katz
nom(n,1,p) result <- subset(result,apply(result,1,sum) > 0) #cases which have at least 1 species result <- unique(result)[1:1000,] Might be interesting to see the effect of varying p on the rest of your analysis. Further memory might be saved by using sparse matrices - see the Matrix pa

Re: [R] autologistic modelling in R

2008-12-20 Thread David Katz
Curiosity and Google lead me to this paper which may be of interest: Assessing the validity of autologistic regression Purchase the full-text article References and further reading may be available for this article. To view references and further reading you must purchase this article. Carste

Re: [R] Population Decay in R

2008-12-15 Thread David Katz
barplot(5000*((1-.26)^(0:49))) jimdare wrote: > > Hi, > > I am new to R. I am trying to plot the decay of a population over time > (0-50yrs). I have the initial population value (5000) and the mortality > rate (0.26/yr) and I can't figure out how to apply this so I get a > remaining populati

[R] tcl/tk example in batch

2008-08-13 Thread David Katz
The example for learning tcl/tk under R at http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/OKtoplevel.html suggests running it from batch - but when I do, the window flashes by and the example ends. I'm under XP pro. Is there a workaround? Should I create a modal window instead so it persists

Re: [R] Case statements in R

2008-07-28 Thread David Katz
See ?cut for creating a factor based on ranges of values. Regards, Wade Wall wrote: > > Hi all, > > I am trying to convert geometric means in a matrix to cover classes. My > values are as such: > > perc<-c(0,0.025136418, 0.316227766, 1.414213562,3.16227766, 7.071067812, > 15.8113883, 35.3

[R] Random Forest %var(y)

2008-07-05 Thread David Katz
The verbose option gives a display like: > rf.500 <- + randomForest(new.x,trn.y,do.trace=20,ntree=100,nodesize=500, +importance=T) | Out-of-bag | Tree | MSE %Var(y) | 20 | 0.9279 100.84 | What is the meaning of %var(y)>100%? I expected that to correspon

[R] mgcv::gam error message for predict.gam

2008-06-11 Thread David Katz
Sometimes, for specific models, I get this error from predict.gam in library mgcv: Error in complete.cases(object) : negative length vectors are not allowed Here's an example: model.calibrate <- gam(meansalesw ~ s(tscore,bs="cs",k=4), data=toplot, weights=weight, gam.method

[R] proto naming clash?

2008-05-15 Thread David Katz
Trying to learn Proto. This threw me: #startup r... > > library(proto) > a <- proto(x=10) > a$x [1] 10 > x <- proto(x=100) > x$x Error in get("x", env = x, inherits = TRUE) : invalid 'envir' argument > Do I simply need to be careful to name proto objects and proto components uniquely? Is this t

[R] mgcv::gam shrinkage of smooths

2008-05-06 Thread David Katz
In Dr. Wood's book on GAM, he suggests in section 4.1.6 that it might be useful to shrink a single smooth by adding S=S+epsilon*I to the penalty matrix S. The context was the need to be able to shrink the term to zero if appropriate. I'd like to do this in order to shrink the coefficients towards

[R] mgcv::predict.gam lpmatrix for prediction outside of R

2008-04-09 Thread David Katz
This is in regards to the suggested use of type="lpmatrix" in the documentation for mgcv::predict.gam. Could one not get the same result more simply by using type="terms" and interpolating each term directly? What is the advantage of the lpmatrix approach for prediction outside R? Thanks. -- View

[R] mgcv::gam prediction using lpmatrix

2008-04-06 Thread David Katz
The documentation for predict.gam in library mgcv gives an example of using an "lpmatrix" to do approximate prediction via interpolation. However, the code is specific to the example wrt the number of smooth terms, df's for each,etc. (which is entirely appropriate for an example) Has anyone gene

Re: [R] re gression trees: mean square vs. absolute errors

2008-03-25 Thread David Katz
You need to think through the application of your model. Is it more important to get more cases classified correctly, or to avoid "bigger" errors versus a probability prediction? You should optimize your choice of a loss function so that it is appropriate to the way in which the model will be used

Re: [R] running balance down a dataframe referring back to previous row

2008-03-19 Thread David Katz
Try: cs <- with(txns,cumsum(cr - dr)) You could if needed adjust the starting value to zero by concatenating a zero in front and dropping the last entry. txns$running.bal <- c(0,cs[seq(length(cs) - 1)]) Good luck. seanpor wrote: > > Good morning, I've searched high and low and I've tried m

Re: [R] error in random forest

2008-03-08 Thread David Katz
I've had the same problem and solved it by removing the cases with the new levels - they need to be handled some other way, either by building a new model or reassigning the factor level to one in the training set. Nagu wrote: > > Hi, > > I get the following error when I try to predict the pr

Re: [R] randomForest() for regression produces offset predictions

2007-12-20 Thread David Katz
I would expect this regression towards the mean behavior on a new or hold out dataset, not on the training data. In RF terminology, this means that the model prediction from predict is the in-bag estimate, but the out-of-bag estimate is what you want for prediction. In Joshua's example, rf.rf$pred

Re: [R] R-help google group archive

2007-12-04 Thread David Katz
Also see www.nabble.com for a very nice interface to current and archived posts. vince-28 wrote: > > I made a google group archive of current and future R-help posts at > http://groups.google.com/group/r-help-archive > > If you are signed-up for the R-help mailing list with a gmail account >

Re: [R] R as server application

2007-11-25 Thread David Katz
This sounds useful, but can you give more info on "forward X...". Thanks. Scionforbai wrote: > > Do you need something more than a simple ssh connection to a remote > host in which you run R (trivial when the server is Linux)? > > My advice is to run R in a "screen" session on the remote host

Re: [R] Largest N Values Efficiently?

2007-11-12 Thread David Katz
ings of tenths of a second matter? (There is also > quantreg::kselect, if you work out how to use it, which apparently is > a bit faster at partial sorting on MacOS X but not elsewhere.) > > > On Sun, 11 Nov 2007, David Katz wrote: > >> >> What is the most efficie

[R] Largest N Values Efficiently?

2007-11-11 Thread David Katz
What is the most efficient alternative to x[order(x)][1:n] where length(x)>>n? I also need the positions of the mins/maxs perhaps by preserving names. Thanks for any suggestions. -- View this message in context: http://www.nabble.com/Largest-N-Values-Efficiently--tf4788033.html#a13697535 Sent