[R] bracketing for optimize

2018-05-31 Thread ivo welch
dear R wizards: `optimize()` requires the user to provide the brackets. I can write a bracketing routine, given a function and a starting point, but I was wondering whether there was already a "standard" user-exposed implementation. (Presumably, this is used in nlm, too; alas, nlm is in C, not n

[R] Finding Optimum of Stochastic Function

2015-05-18 Thread ivo welch
gards, /iaw ---- Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

[R] lattice contourplots

2015-06-01 Thread ivo welch
within(d, z <- sin(x+y)) quartz() contourplot( z ~ x * y, data = d) am I committing an error, or is there something more robust or at least verbose, perhaps? help appreciated. /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ _

Re: [R] lattice contourplots

2015-06-01 Thread ivo welch
n interactive mode regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ J. Fred Weston Professor of Finance Anderson School at UCLA, C519 Director, UCLA Anderson Fink Center for Finance and Investments Free Finance Textbook, http://book.ivo-welch.info/ Editor, Cr

[R] combine trellis lattice contour plot with simple plot() points() and text() commands?

2015-06-01 Thread ivo welch
e probably looking at adjacent points, pretending that they are linear, and mark where a line between them intercepts the level, and then hope that some sanity prevents me from connecting disconnected levels. not my plan...] Ivo Welch (ivo.we...@gmail.com) http://www.ivo-

[R] Learning to Write R Packages (Libraries) with Documentation

2019-02-17 Thread Ivo Welch
I would like to put together a set of my collected utility functions and share them internally. (I don't think they are of any broader interest.) To do this, I still want to follow good practice. I am particularly confused about writing docs. * for documentation, how do I refer to '@'-type docum

[R] SQL Primer for R

2008-08-25 Thread ivo welch
Dear R wizards: I decided to take the advice in the R data import/export manual and want to learn how to work with SQL for large data sets. I am trying SQLite with the DBI and RSQLite database interfaces. Speed is nice. Alas, I am struggling to find a tutorial that is geared for the kind of stan

[R] R-ish challenge for dependent ranking

2008-08-25 Thread ivo welch
Dear R wizards: First, thanks for the notes on SQL. These pointers will make it a lot easier to deal with large data sets. Sorry to have a second short query the same day. I have been staring at this for a while, but I cannot figure out how to do a dependent ranking the R-sh way. ds= data.fra

Re: [R] R-ish challenge for dependent ranking

2008-08-25 Thread ivo welch
thank you everybody, again. regards, /iaw __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, repr

Re: [R] SQL Primer for R

2008-08-26 Thread ivo welch
Sorry, chaps. I need one more: > dbDisconnect(con.in) Error in sqliteCloseConnection(conn, ...) : RS-DBI driver: (close the pending result sets before closing this connection) > I am pretty sure I have fetched everything there is to be fetched. I am not sure what I need to do to say goodbye (

[R] error instead of warning?

2008-08-31 Thread ivo welch
dear R experts---is it possible to ask R to abort with an error instead of just giving a warning when I am mis-assigning vectors (or other data structures) that are not compatible? that is, I would like 1: In matrix(value, n, p) ... : data length [12] is not a sub-multiple or multiple of the nu

Re: [R] SQL Primer for R

2008-08-31 Thread ivo welch
stumped again by SQL... If I have a table named "main" in an SQLite data base, how do I get the names of all its columns? (I have a mysql book that claims the SHOW command does this sort of thing, but it does not seem to work on SQLite.) regards, /iaw PS: Thanks for the earlier emails on "warn

Re: [R] SQL Primer for R

2008-09-01 Thread ivo welch
wow! the answer seems to be "pragma table_info(main);" thanks, Gabor. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

[R] debugging

2008-09-01 Thread ivo welch
dear R wizards---I am not sure at what point I owe pennance for asking so many questions. I am now wrangling debugging. I want to write a function assert = function( condition, ... ) { if (!condition) { cat(...); cat("\n"); browser(); } stopifnot(condition); } assert( nrow(ds)==12,

[R] email just sent

2008-09-01 Thread ivo welch
please ignore part 1. of course, the cat works. my mistake. I just need to learn how to step up frames, please. regards, /iaw __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://w

[R] constrOptim parameters

2009-09-11 Thread ivo welch
e dimensions actually are. this is not hard to find out by hand, but it would still be useful. regards, /iaw -- Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list htt

[R] 64-bit OSX binary for 2.9.2

2009-09-14 Thread ivo welch
a "standard recommended" rather than just a "boutique" version?) sincerely, /iaw -- Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://

[R] Location of Packages?

2009-09-14 Thread ivo welch
under the command line version, which I presume is still 32-bit, and the 64 bit GUI. PPS: how do I learn which version of R is running? regards, /iaw -- Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) [[alternative HTML version deleted]] _

Re: [R] Location of Packages?

2009-09-14 Thread ivo welch
thanks, everyone. I was a bit confused. I now think that the "car" error was because the package on the cran website itself was built under 2.9.2, not because I had an old version lying around, which my package continued to use instead of a newer version that I would just have installed. I was a

[R] fastest OLS w/ NA's and need for SE's

2009-09-14 Thread ivo welch
mmary(lm())? can someone tell me the "fastest" way to generate b and se(b)? is there anything else that comes to mind as a recommended way to speed this up in R, short of writing everything in C? as always, advice highly appreciated. /iaw -- Ivo Welch (ivo.we...@brown.edu, ivo.

[R] why is nrow() so slow?

2009-09-15 Thread ivo welch
is possible to ask "by" to attach an attribute to the data frame that stores the number of observations that it is actually passing. pointers appreciated. regards, /iaw -- Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) [[alternative HTML version deleted]]

Re: [R] why is nrow() so slow?

2009-09-15 Thread ivo welch
hi david---no, this time I actually know what I was asking ( ;-) ). I do need speed computed on many data sets, each of which is created by a "by" statement. so, no iterative programming on my side. thanks, hadley for the pointer to .row_names_info() in lieu of dim() or nrows(). I don't seem t

Re: [R] why is nrow() so slow?

2009-09-15 Thread ivo welch
e. > One note: if you're worried about speed, it almost always makes sense to use matrices rather than dataframes. If you've got mixed types this is tedious and error-prone (each type needs to be in a separate matrix), but if your data is all numeric, it's very simple, and will

[R] cluster-lite

2009-09-15 Thread ivo welch
I will probably rely on a mixed R/perl system here. This is not desirable, but it is the only way I know how to do this. if something like multisystem() already exists in R native, please let me know and save me from reinventing the wheel. if it does not, some perl/R combo for this soon will. regards

[R] lm() with non-linear coefficients constraints? --- nls?

2010-04-29 Thread ivo welch
dear R experts---quick question. I need to estimate a model that looks like y = (b*T+d*T^3) + (1-b-3*d*T^2)*x + (3*d*T)*x^2 + (-d)*x^3 I only have three parameters. Is nls() the right tool for the job, or is there something faster/better? /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we

[R] lm() with non-linear coefficients constraints? --- nls?

2010-04-29 Thread ivo welch
dear R experts---quick question. I need to estimate a model that looks like y = (b*T+d*T^3) + (1-b-3*d*T^2)*x + (3*d*T)*x^2 + (-d)*x^3 I only have three parameters. Is nls() the right tool for the job, or is there something faster/better? /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we

[R] pointers needed to expected values of fractions

2009-05-09 Thread ivo welch
I apologize in advance for a more statistical question. I am trying to find out whether a transformation of two random variables X and Y ( z= g(X,Y) ) exists whose expected value is E(X)/E(Y). obviously, it ain't E(X/Y). is there a book or place where I could learn this? (Also, I would be intere

[R] very fast OLS regression?

2009-03-25 Thread ivo welch
Dear R experts: I just tried some simple test that told me that hand computing the OLS coefficients is about 3-10 times as fast as using the built-in lm() function. (code included below.) Most of the time, I do not care, because I like the convenience, and I presume some of the time goes into s

Re: [R] very fast OLS regression?

2009-03-25 Thread ivo welch
thanks, dimitris. I also added Bill Dunlap's "solve(qr(x),y)" function as ols5. here is what I get in terms of speed on a Mac Pro: ols1 6.779 3.591 10.37 0 0 ols2 0.515 0.21 0.725 0 0 ols3 0.576 0.403 0.971 0 0 ols4 1.143 1.251 2.395 0 0 ols5 0.683 0.565 1.248 0 0 so the naive matrix operation

[R] package installation on OSX --- suggestion

2009-03-26 Thread ivo welch
dear R experts: I am trying to install packages in OSX, R 2.8.1. Since I do this about every 2 years, I have completely forgotten it. However, this should not be difficult: http://wiki.r-project.org/rwiki/doku.php?id=getting-started:installation:packages nice document. beautiful method.

Re: [R] pgmm (blundell-bond) help needed

2009-03-26 Thread ivo welch
I have been playing with more examples, and I now know that with larger NF's my example code actually produces a result, instead of a singular matrix error. interestingly, stata's xtabond2 command seems ok with these sorts of data sets. either R has more stringent requirements, or stata is too ca

[R] Hurwicz Bias Correction

2009-04-13 Thread ivo welch
Dear Experts---Sorry, I need some help again. I need a very fast estimator for small sample time-series in which the autocoefficient can be anything between 0 and 2 (i.e., even beyond the unit-root). I think this means that I will need to run OLS. Of course, this means that I will run into the H

[R] static variable?

2009-04-16 Thread ivo welch
dear R experts: does R have "static" variables that are local to functions? I know that they are usually better avoided (although they are better than globals). However, I would like to have a function print how often it was invoked when it is invoked, or at least print its name only once to STD

[R] fast lm se?

2010-01-08 Thread ivo welch
compute (X' X)^(-1) s^2 myself. Has someone written a fast se() function? incidentally, I think this would make a nice addition to the R base. I presume it is not uncommon for a statistician also to want to use the se of coef estimates. pointers appreciated. regards, /iaw Iv

Re: [R] fast lm se?

2010-01-08 Thread ivo welch
tions, 'lm.fit' for plain, and 'lm.wfit' for weighted regression fitting." ADD: These can be orders of magnitude faster. thank you, everyone. regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) On Fri, Jan 8, 2010 at 9:08 AM, Dirk Eddelbue

[R] sorted reshaping?

2010-01-22 Thread ivo welch
"wide"), and the shape seems to be what I want, but the columns come out in random order (sim1.1980, then sim1.2001, then sim1.1977) and so on. I would like years to go from left to right, too. Is there an easy way to accomplish this? sincerely, /iaw Ivo Welch (iv

Re: [R] sorted reshaping?

2010-01-23 Thread ivo welch
see also", I would add library(reshape). finally, it would be nice if an email would be on each R help (in R documentation) to make suggestions for improvements. regards, /iaw Ivo Welch (ivo.we...@brown.edu, ivo.we...@gmail.com) __ R-help@r-proj

[R] parallel number of cores according to memory?

2020-07-07 Thread ivo welch
if I understand correctly, R makes a copy of the full environment for each process. thus, even if I have 32 processors, if I only have 64GB of RAM and my R process holds about 10GB, I should probably not spawn 32 processes. has anyone written a function that sets the number of cores for use (in m

Re: [R] parallel number of cores according to memory?

2020-07-07 Thread ivo welch
ugghhh---apologies. although in 2020, it would be nice if the mailing list had an automatic html filter (or even bouncer!) I am using macos. alas, my experiments suggest that `mclapply()` on a 32-core intel system with 64GB of RAM, where the input data frame is 8GB and the output is about 500MB

Re: [R] parallel number of cores according to memory?

2020-07-07 Thread ivo welch
no, I'm not. mostly conventional use afaik. if this should not be happening, I can trace it down to a small reproducible example to figure it out. -- Ivo Welch (ivo.we...@ucla.edu) -- Ivo Welch (ivo.we...@ucla.edu) http://www.ivo-welch.info/ J. Fred Weston Distinguished Professor of Fi

[R] memory allocation and management question

2013-07-15 Thread ivo welch
reference? I may be blanking here---maybe the answer is obvious.) regards, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] memory allocation and management question

2013-07-15 Thread ivo welch
thx, jim. makes perfect sense now. I guess a logical in R has a few million possible values ;-). (Joke. I realize that 4 bytes is to keep the code convenient and faster.) regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, Jul 15, 2013 at 4:26 PM, jim holtman wrote: > I can g

[R] C Interface in R

2013-07-17 Thread ivo welch
below. best to be ignored. /iaw Ivo Welch (ivo.we...@gmail.com) --- the as75.R file, at least as of july 2013 ### see end of file for documentation debug <- 0 if (debug) cat(rep("\n",10)) ## visual separation dyn.load("Ras75.so") # created with R CMD SH

[R] model syntax processed --- probably common

2013-08-19 Thread ivo welch
avoid losing the column name. I wonder why such vectors don't keep a name attribute of some sort. there is probably an "R way" of doing this. is there? /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] ___

Re: [R] model syntax processed --- probably common

2013-08-19 Thread ivo welch
for (nm in c("x")) print(fama.macbeth( y ~ d[[nm]], din=d )) or whatever. the output in both cases should be the same, preferably even knowing that the name of the variable is really "x" and not nm. is there a standard common way to do this? regards, /iaw Ivo W

[R] new.env() and attach for write?

2013-08-28 Thread ivo welch
py the globalenv, run my code, see what objects have been changed (how?), move the changed and new functions into my a environment, and then restore globalenv. or is this already done somewhere else? /iaw ---- Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version d

Re: [R] new.env() and attach for write?

2013-08-28 Thread ivo welch
duh! Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ J. Fred Weston Professor of Finance Anderson School at UCLA, C519 Director, UCLA Anderson Fink Center for Finance and Investments Free Finance Textbook, http://book.ivo-welch.info/ Editor, Critical Finance Review, http

[R] get syntax for inherited environments

2013-09-05 Thread ivo welch
ive of z(), function x is not an enclosing environment. do I write a while loop to look back, or is there a standard R function that searches all calling environments until it finds one that works? regards, /iaw Ivo Welch (ivo.we...@gmail.com)

[R] parallelized version of "by" and "ave"

2012-12-24 Thread ivo welch
#x27;s version of "by" is mclapply( split( ds, factor ), FUN ) I don't know the poor man's version of "ave". sincerely, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ __ R-help@r-project.org mailing list

[R] parallel error message extraction (in mclapply)?

2012-12-28 Thread ivo welch
ded to the docs for mclapply? /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

[R] multiple versions of function

2013-01-07 Thread ivo welch
t BS has to parse an '...' argument, but there could be a couple of magical R functions that might make this easier than I would do it with my planned clunky version. what's the elegant version? /iaw Ivo Welch (ivo.we...@gmail.com)

Re: [R] multiple versions of function

2013-01-07 Thread ivo welch
hi david---can you give just a little more of an example? the function should work with call by order, call by name, and data frame whose columns are the names. /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, Jan 7, 2013 at 4:25 PM, David Winsemius wrote: > > On Jan 7, 2013, at 3

Re: [R] multiple versions of function

2013-01-09 Thread ivo welch
t 8:00 AM, David Winsemius wrote: > > On Jan 7, 2013, at 6:58 PM, ivo welch wrote: > >> hi david---can you give just a little more of an example? the >> function should work with call by order, call by name, and data frame >> whose columns are the names. /iaw >>

[R] width of terminal resize to current dimensions on linux Gnome terminal

2013-01-29 Thread ivo welch
e a way to add a TaskCallback only when a user resizes the window? help appreciated... /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://w

[R] First R Package --- Advice?

2013-02-05 Thread ivo welch
n all default autovivification off in my program, but that's not possible.) /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

Re: [R] First R Package --- Advice?

2013-02-05 Thread ivo welch
contemplating the core logic of lm() extensions is distracting at the first baby steps. similarly, rstudio is a really nice IDE, but I don't think that roxygen2 and devtools need rstudio. could someone point me to a simpler "starting" document for roxygen2 and devtools, if such exis

Re: [R] First R Package --- Advice?

2013-02-05 Thread ivo welch
actually, I may have found what I was looking for in https://github.com/hadley/devtools/wiki/Philosophy --- Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] First R Package --- Advice?

2013-02-06 Thread ivo welch
eight than .Rd and more heavyweight than just '#' comments. /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proj

[R] Hard Stop?

2013-02-06 Thread ivo welch
is it possible to throw a stop() that is so hard that it will escape even tryCatch? /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] simple pdf font embedding example for Bera

2013-02-08 Thread ivo welch
ev.off; and/or if pdfFonts could take an optional .pfbdir that embedFonts would search. but this is pretty painless already as is, esp to how it was 5 years ago. thanks to all the folks that put in the hard work to make this possible. [PS: The abov

[R] character strings with embedded commands: perl "/gee" ?

2013-02-08 Thread ivo welch
a", class(d), "with names", names(d)), but I also want to be define %or% so that I can write (is.data.frame(d)) %or% "d is a ::class(d):: with names ::names(d)::" ; operators don't take variable arguments afaik. :-(. advice

Re: [R] character strings with embedded commands: perl "/gee" ?

2013-02-09 Thread ivo welch
"column a1 is not numeric" } I also find it useful to have an optional length argument for is.numeric or is.character, which requires the argument to be of length x, but this is another story. /iaw On Fri, Feb 8, 2013 at 4:01 PM, ivo welch wrote: > dear R experts---I am try

Re: [R] First R package, advice

2013-02-09 Thread ivo welch
atex and R? I could live with rolling my own IF ONLY my ide/editor would understand my new format. I do not have the skills to tell emacs how to switch syntax-highlighting in the middle of files. this collective path-dependence will plague us for decades, having created a cost

[R] Light Libraries

2013-02-25 Thread ivo welch
* lagseries:52:: Need more observations than 1* ## [b] evaluate every {{ }} construct and insert output into the string ## [c] abort "%or%" <- function (e1, e2) { if (!e1) { if (is.character(e2)) abort.estring(e2) else eval(e2) } } I do not know whether it is possible to bu

Re: [R] Light Libraries

2013-02-26 Thread ivo welch
m greatly indebted to you, Uwe, and a couple of others to have helped me out many times to solve problems I have run into. without r-help, I would have given up on it. regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ On Tue, Feb 26, 2013 at 6:35 AM, Uwe Ligges wrot

[R] Parallelizing Other Apply Functions, e.g. by, the Easy (Wrong?) Way

2013-02-26 Thread ivo welch
as only one change---the optional argument. this is not hard to do, but I now run the risk that the R team could change by(). I wish I could at least test whether the by() function changes from release to release to alert me, but functions are not atomic and therefore cannot be compared. what

[R] R Compiler Options in the linux (ubuntu) Binaries? AVX?

2013-03-04 Thread ivo welch
curiosity question: I was wondering whether the R binaries and BLAS libraries for ubuntu linux are compiled using SSE4 and AVX support. this probably can go a long way towards a unified memory bus GPGPU substitute. Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info

[R] identifying and drawing from T distribution

2013-03-15 Thread ivo welch
there a better way to do this? there is a non-centrality parameter ncp in rt, but one parameter ncp cannot subsume two (m and s), of course. my first attempt was to draw rt(..., df=2.63)*s+m, but this was obviously not it. advice appreciated. /iaw Ivo Welch (ivo.we...@gmail.com) http

Re: [R] identifying and drawing from T distribution

2013-03-16 Thread ivo welch
actually, I had it right all along. that is, m<- runif(); s<- runif(); df<-runif()*10+1 # get some parameters...any parameters x <- rt( 10, df )*s + m # create random draws library(MASS) fitdistr(x, "t") # confirm properties will work. (josh suggested working with the skewness parameter,

[R] categorized complete list of R commands?

2013-04-03 Thread ivo welch
el related" for lm; and another categorization for importance (e.g., like "common" for lm and "obscure" for ..). Such categorizations require intelligence. if I am going to do this for myself, I think a csv spreadsheet may be a good idea to make it easy to resort by keys.

Re: [R] categorized complete list of R commands?

2013-04-04 Thread ivo welch
es seems like a good idea. git and control is overkill here. regards, /iaw Ivo Welch (ivo.we...@gmail.com) http://www.ivo-welch.info/ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] categorized complete list of R commands?

2013-04-04 Thread ivo welch
ipt in perl and self-parse the .Rd files that are strewn around my hard drive, or whether there is an idiomatic R way... best, /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

[R] pR2 stumped

2013-05-06 Thread ivo welch
ess=TRUE, data=d, method="probit" )) print(pp) cat(" (main) now we do the pseudo R^2\n") print(pR2(pp)) cat(" ok\n") summarize(d) Error in eval(expr, envir, enclos) : object 'p' not found. Ivo Welch (ivo.we...@gmail.

[R] ecdf --- title suggestion and question

2013-05-08 Thread ivo welch
my own title" plot(ee) alas, I cannot figure out how to get rid of the title altogether. attr(ee,"call") <- NULL gives me two quotation marks ("") . is it possible to remove the title altogether? regards, /iaw Ivo Welch (ivo.we...@gmail.com) _

Re: [R] ecdf --- title suggestion and question

2013-05-08 Thread ivo welch
ooops...never mind. I mixed up "title" and "main" as options. Ivo Welch (ivo.we...@gmail.com) On Wed, May 8, 2013 at 1:54 PM, Steve Lianoglou wrote: > Hi Ivo, > > On Wed, May 8, 2013 at 1:37 PM, ivo welch wrote: >> dear R-experts---first, a sugges

[R] R's basic lm() and summary.lm functions

2013-05-10 Thread ivo welch
# the standard errors } if (!is.null(lm.hook)) lm.hook() ## has access to everything that lm() has already computed Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] R's basic lm() and summary.lm functions

2013-05-10 Thread ivo welch
I ended up wrapping my own new "ols()" function in the end. it is my replacement for lm() and summary.lm. this way, I don't need to alter internals. in case someone else needs it, it is included. of course, feel free to ignore. docs[["ols"]] <- c(Rd= ' @TITLE ols.R @AUTHOR ivo.we...@gmail.com

Re: [R] R's basic lm() and summary.lm functions

2013-05-11 Thread ivo welch
you get what you pay for. more generally, I am still wondering why we have an lm and a summary.lm function, rather than just one function and one resulting object for parsimony, given that the summary.lm function is fast and does not increase the object size. Ivo Welch (ivo.we...@gmail.com)

[R] what does summary(polr(...)) really call?

2013-05-13 Thread ivo welch
dear R experts---how do I determine what summary(polr( y ~ x )) calls? it is not summary.lm(polr(y~x)) or summary.mlm or summary.glm, or stats:::summary.lm or ... in fact, none of the summary methods seem to invoke what summary invokes. advice, as always, appreciated. regards, /iaw Ivo

Re: [R] what does summary(polr(...)) really call? --- and obscure buglet

2013-05-13 Thread ivo welch
norm(N)*10)) print(head(pairs)) ## works p <- polr( y ~ x , method="probit", data=pairs) print(summary(p)) pairs is saved as a name. eventually, summary.polr thinks it is the pair function, not the pair data frame. /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, May 13, 2013

[R] reading large csv data sets efficiently

2013-05-22 Thread ivo welch
gs, or does it handle this line by line as it goes? (if it does the former, I can write a perl pre-filter) /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] curiosity: next-gen x86 processors and FP32?

2013-05-25 Thread ivo welch
an do to drastically speed up R on intel i7 by going to FP32? regards, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/

Re: [R] curiosity: next-gen x86 processors and FP32?

2013-05-26 Thread ivo welch
##.#. Live Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------

[R] updating observations in lm

2013-05-27 Thread ivo welch
rors of coefficients. before I get started on this, I just wanted to inquire whether someone has already written such a function. regards, /iaw Ivo Welch (ivo.we...@gmail.com) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] updating observations in lm

2013-05-27 Thread ivo welch
o updating models, not observations. even if it did, given the speed of lm(), I don't think it will be that useful. regards, /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, May 27, 2013 at 9:26 AM, Bert Gunter wrote: > Ivo: > > 1. You should not be fitting linear models as you des

Re: [R] updating observations in lm

2013-05-27 Thread ivo welch
Gentlemans as 274 algorithm allows weights, so adding an obs with a weight of -1 would do the trick of removing obs, too. This may be a good job for hadwell wickhams c code interface. On May 27, 2013 12:47 PM, "Berend Hasselman" wrote: > > On 27-05-2013, at 17:12, ivo welch w

[R] Rcpp Starter With Carry Class

2013-05-28 Thread ivo welch
I read Hadley's excellent Rcpp tutorial at https://github.com/hadley/devtools/wiki/Rcpp. Alas, there is one part that is missing---how do I maintain a memory region between calls? Here is a stylized example of what I mean: extern "C" { #include #include } #include class silly { double *v; i

[R] read.csv and write.csv filtering for very big data ?

2013-06-03 Thread ivo welch
ss, and make sure that the processes don't step on one another. (why did R not use a dot after "mc" for parallel lapply?) presumably, to keep it simple, mcfilter.csv would keep a counter of read chunks and block write chinks until the next sequential chunk in order arrives. just a sug

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-04 Thread ivo welch
that a built-in R filter function could provide. Ivo Welch (ivo.we...@gmail.com) On Tue, Jun 4, 2013 at 2:56 PM, Greg Snow <538...@gmail.com> wrote: > Some possibilities using existing tools. > > If you create a file connection and open it before reading from it (or > wr

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-05 Thread ivo welch
useful only for big files anyway. is it possible to block write.csv across multiple threads in mclapply? or hook a single-thread function into the mclapply collector? /iaw On Wed, Jun 5, 2013 at 5:06 AM, Duncan Murdoch wrote: > On 13-06-05 12:08 AM, ivo welch wrote: > >> thx, greg.

Re: [R] read.csv timing

2013-06-10 Thread ivo welch
ly has no decompression penalty and becomes close to native fast reading of .gz data. chances are this is because it has .gz support baked in. gzfile does not help with read.csv, however. /iaw Ivo Welch (ivo.we...@gmail.com) On Mon, Jun 10, 2013 at 10:09 AM, ivo welch wrote: >> Sur

[R] load() into a data frame with my chosen name => .ThisEnv ?

2013-06-17 Thread ivo welch
] ~ d[,2]) ) ## calculate two coefficients and return them } results <- mclapply( 1:1, run ) stumped over something that should be easy...pointer appreciated. /iaw Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted]]

[R] canonical AR1 w/ measurement error -> pointers?

2013-06-20 Thread ivo welch
ved a gazillion times. could someone please point me to some simple textbook = howto treatments of this problem and/or R packages that implement this? feel free to point out your own work...this way I can cite it. regards, /iaw ---- Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version de

Re: [R] canonical AR1 w/ measurement error -> pointers?

2013-06-20 Thread ivo welch
thanks, mark. these are excellent starting pointers. I will get to them asap. I hope I won't need to bother you more. regards, /iaw [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] R Benchmarks

2013-06-28 Thread ivo welch
Dear R group: I just bought a Haswell i7-4770k machine, so I went through the trouble of creating a small website with some comparative benchmarks. I also made it easy for others to contribute benchmarks. if you are interested, it's all at http://R.ivo-welch.info/ . enjoy. /iaw ---- Ivo

[R] advice on big panel operations with mclapply?

2013-07-02 Thread ivo welch
large data sets. I saw some specific solutions on stackoverflow, a couple requiring even less parsimonious user code. is everyone using bigmemory? or SQL? or ... ? I am leaning towards the SSD solution. am I overlooking some simpler recommended solution? /iaw Ivo Welch (ivo.we...@gmai

[R] better an error?

2014-04-10 Thread ivo welch
I am personally happy to live with R for its power despite its drawbacks; but IMHO it is just too much to ask from a set of bewildered novice master students. I hope the R team will at some point in the future pick up on making the core language less mysterious upon setting an option, at least in &q

[R] kaveri with R on GPU?

2014-04-17 Thread ivo welch
does anyone have a kaveri based system with R recompiled to use its GPU? is this even possible today? regards, /iaw PS: I am trying to collect benchmarks http://r.ivo-welch.info/ Ivo Welch (ivo.we...@gmail.com) [[alternative HTML version deleted

Re: [R] vectorized uni-root?

2012-11-08 Thread ivo welch
e non-vectorized version. /iaw On Thu, Nov 8, 2012 at 9:53 AM, R. Michael Weylandt wrote: > On Thu, Nov 8, 2012 at 3:05 PM, ivo welch wrote: >> dear R experts--- I have (many) unidimensional root problems. think >> >> loc.of.root <- uniroot( f= function(x,a) log( exp(

[R] contour plot axis correspondence

2013-11-16 Thread ivo welch
I am struggling with a contour plot. I want to place a cross over the minimum. alas, I don't seem to be able to map axes appropriately. here is what I mean: N <- 1000 rm <- rnorm(N, mean=0.0, sd=0.4) rx <- rnorm(N, mean=0.0, sd=0.4) rt <- rnorm(N, mean=0.0, sd=0.4) exploss <- function(hdgM,hdg

  1   2   3   >