« first day (688 days earlier)      last day (2487 days later) » 

12:03 AM
awesome: "Wickham, C. (2008). Modeling Whale Shark Movement."
ok I'm done Whickham stalking now
off to dinner
 
 
5 hours later…
4:58 AM
@joran I've tried to convert my wife to R, but she learned Stata and isn't willing to convert.
I am thinking of ordering a onesie for our forthcoming baby with the useR logo on it.
We got one for our first child that read "ANROMDI!ZE" on it (my wife and her colleagues do a lot of RCTs).
 
 
3 hours later…
7:37 AM
Is anyone working with this? stackoverflow.com/questions/12294185/…
 
Not me
 
@AriB.Friedman Oh boy, changes again. :/
 
voting to close as being too localized
the OP is having a problem with a particular file
@RomanLuštrik looks like a nice challenge. Probably will involve the rgeos package, or a link with say Grass or Saga.
sry, this was the question I was voting to close
 
Are any of you familiar with k-fold cross-validation techniques using R?
Google points me to packages DAAG, bootstrap, etc.
 
@Andrie I've used them a lot in spatial statistics
but then there are specialized functions
in essence the procedure is simple and can be coded quite easily
 
7:48 AM
If I want to use k-fold CV, but using my own custom-developed regression model, which frameworks are useful?
@PaulHiemstra I am tempted to just write it myself, yes.
 
In essence what you do is in the prediction step you throw away a subset of the data
and predict that subset
allowing you to compare them both
 
Yes, I know how it works.
 
this should not be more than a dozen lines of code
 
I just don't want to reinvent the wheel for the CV bit
 
@Andrie sry no insult intended
 
7:49 AM
OK, you've convinced me.
I'll go the DIY route.
 
@Andrie :)
automap:::summary.autoKrige.cv
function (object, ..., digits = 4)
{
obj = object$krige.cv_output
out = list()
out$mean_error = mean(obj$residual)
out$me_mean = out$mean_error/mean(obj$observed)
out$MAE = mean(abs(obj$residual))
out$MSE = mean(obj$residual^2)
out$MSNE = mean(obj$zscore^2)
out$cor_obspred = cor(obj$observed, obj$observed - obj$residual)
out$cor_predres = cor(obj$observed - obj$residual, obj$residual)
out$RMSE = sqrt(sum(obj$residual^2)/length(obj$residual))
out$RMSE_sd = out$RMSE/sd(obj$observed)
this is a function in the package I wrote
which contains a number of metrics which you can use to evaluate the results of the CV
in CV I always find remembering these metrics quite a pain:)
@Andrie the function above with some metrics might be interesting to you
 
Thank you.
I've also just discovered package cvTools
 
@Andrie looks like a nice package
 
8:06 AM
You mean cv.glm?
 
I remember using cv function at one point. It was years ago, though.
Sorry to be of little to no help. :)
But basically you specified K and it would split your dataset and do a cross-validation on that.
The code is on my remote computer to which I don't have access right now, grrr.
 
8:29 AM
@PaulHiemstra Looks to me like he's trying to merge PUMAs. The final result looks like there are PUMA1, PUMA2, PUMA3+4 and PUMA5+6.
I don't see how county borders play a role here.
 
9:00 AM
@PaulHiemstra the package cvTools is easy to use and seems to work quite well.
Three lines of code required:
1. The call that defines the model
2. The folds definition
3. cvFit
Done
 
9:32 AM
k-fold crossvalidation is easy:
1) Open K browser tabs.
2) Point them all at http://stats.stackexchange.com
4
 
@Andrie might be interesting to look at it some day
 
@AriB.Friedman Star, of course
 
10:08 AM
Obviously.
Where's Shane, btw?
 
10:32 AM
@Andrie I admit to pandering for a star or two there ;-)
 
 
1 hour later…
12:00 PM
3
A: How to visualize a map from a netcdf file?

plannapuslibrary(ncdf) # I'm assuming this is the netcdf file you are working with: download.file("http://dods.ipsl.jussieu.fr/gswp/Fixed/SoilDepth.nc", destfile="SoilDepth.nc") soil <- open.ncdf("SoilDepth.nc") #The way to extract a variable is as following: soil$var[[3]] -> var3 # here, as shown i...

The OP in this question just continues to add new aspects to his question...
I now recommended to him to open a new question
 
Yeah, I saw that. Some people are new to Q&A site concept.
@Paul, do you know if any one is working on rgeos vignette?
 
@Roman some people do not try and figure stuff out themselves, he just kept on asking for more details, posting problems as he went along
@Roman no idea if anyone is working on that
 
I have an email from Roger from a while back where he called if someone would whip something up. I was wondering if anyone took the project.
 
no idea
 
No, no vignette available, the best available guide at the root is from JTS:

vividsolutions.com/jts/bin/JTS%20Technical%20Specs.pdf

which was used in writing rgeos. This is on TODO lists, but not at the top, sorry; contributions gratefully received!
 
12:07 PM
In regard to the question about netcdf
the OP is now switching the green tickmark to an answer which, in my view, was the least helpful...
 
Since he switched the tickmark to each questions, one at a time, he probably thinks he's validating all of them....
("each answers" and not "each questions" of course)
 
 
1 hour later…
1:23 PM
@MatthewDowle, thanks for your comment on that post. I tried out omitting J(), with different orders of IDs and got the answer I expected, as if the join were still being conducted on the IDs.
My mistake. A brain fart.
 
1:50 PM
Interesting r-devel discussion.
 
@RomanLuštrik Speaking of people that don't understand the site: stackoverflow.com/questions/12237827/…
 
@DirkEddelbuettel if(--as-cran)?
 
2:07 PM
Yes. Disconnect between CRAN and developers.
 
@DirkEddelbuettel What'd you think about someone suggesting that authors should pay to upload to CRAN? My feeling is that the authors are contributing and CRAN should be happy to get free code.
 
@GSee Didn't like it. Not everybody is an academic with grants to spare as Jim Ramsay. But I also try to pay little attention to what Spencer posts. I find him mostly confused most of the time.
 
2:24 PM
@GSee I tried to undo the edit to get the question back
Maybe someone with more rep could try
 
@PaulHiemstra Guess we should have done that before closing. But, frankly, it should just be deleted and forgotten forever.
 
@GSee @PaulHiemstra I simply voted to delete it.
Hmmm...it appears we will be walking someone through each step of a base graphics project today.
 
2:42 PM
Link?
 
@PaulHiemstra This is my guess: stackoverflow.com/users/1392044/…
 
@GSee Bingo.
 
 
2 hours later…
4:29 PM
Grrrrrrrrr.
 
@joran yay!
 
@JoshuaUlrich Is there some sort of inverse relationship going on here? So if I stub my toe really hard, will some part of your body feel really good?
 
Sure. Misery loves company.
What are you growling about?
 
4:45 PM
@joran - that did not happen after beating my head into my desk repeatedly
 
@JoshuaUlrich A certain person asking for assistance with plots who seems immune to researching their problem.
@Chase That's funny. I suddenly feel fantastic.
 
5:04 PM
3 ARMv5 devices ( dockstars and Guru Plug Server Plus ) and soon to be 3 older computers ( Celeron and P4s with 2+GB each)... and the need for a local cluster... This should be fun. :)
 
 
4 hours later…
8:59 PM
Hi @TylerRinker. I don't know how to make your code work, but I see one thing that is wrong with it. You need to pass parse separately from the dots.
 
Can somebody please remind me what's the canonical way in R to write recursive functions?
 
@Andrie Sure: don't.
 
I have a function that generates a matrix from a model.frame, then recursively needs to pass the result to the same function, in the process growing the input matrix.
@JoshuaUlrich That's what I thought, but my mind is blank on what the alternative is.
So: two problems...
1) I don't have the full matrix at the start of the process, so can't use sapply.
2) The matrix grows, not shrinks, so I don't think Reduce does it either.
 
Can you send me an example?
 
What I do at the moment is to call my function in a for loop (yuck) and grow the result.
OK. give me a few minutes to make it a little bit prettier.
 
9:14 PM
@Andrie That's the height of naughtiness! I thought you'd know better... didn't you warn about doing that in your book?
 
@JoshuaUlrich I don't know. Haven't read it yet.
 
tsk tsk
 
9:50 PM
@JoshuaUlrich git@gist.github.com:6ee14a39dd82f5064215.git
This code is the start of an implementation of correlated component regression:
 
@Andrie Um, what am I supposed to do with that?
 
yes, that worked
 
10:08 PM
Not sure you can get away from the recursion, but you should be able to pre-allocate the result... and there are some other things you could do to make it faster.
 
yes, it's definitely recursive.
I'm already pre-allocating, but probably not in an efficient way.
For now, it's good enough for me.
I now need to get the actual regression working.
Then I'll start to think about speed-up
 
cc will have NCOL(mf)-1 rows and max.k columns, right?
 
Yes.
Ahah, of course. I can allocate only once.
 
you also don't need first; you can initialize kn <- rep(0,NROW(mf)) instead of setting first <- TRUE
...that makes your sapply call much simpler
 
10:28 PM
@JoshuaUlrich that's very clever.
 
10:38 PM
@Andrie Thanks. Here's how I'd implement your function:
.ccrComp <- function(mf, max.k=NCOL(mf)-1){
  f <- function(i) tail(coef(lm(mf[[1]]~kn+mf[[i+1]])), 1)
  cc <- matrix(NA, ncol=max.k, nrow=NCOL(mf)-1)
  for(i in seq_len(max.k)){
    if(i==1) {
      kn <- rep(0,NROW(mf))
    } else {
      kn <- as.matrix(mf[,-1]) %*% cc[,1:(i-1)]
    }
    cc[,i] <- sapply(seq_len(length(mf)-1), f)
  }
  cc
}
 
@JoshuaUlrich Wow, that's brilliant
 
Glad to help. :) Also, I'd probably just move it into ccr.lm, unless you're going to use it somewhere else too.
 
@JoshuaUlrich why rep(0,NROW(mf)) instead of numeric( NROW(mf) ) ? I'm just seeing this ( out of context ) ...
 
@Thell /me shrugs. No particular reason. Just got in the habit of using rep because a lot of times I use it to create a vector of NA.
 
gotcha
 
10:45 PM
I guess I could do numeric(NROW(mf))*NA :)
but that's more typing; and I'm lazy
boost finally finished unpacking
Now I can finally build QuantLib
 
LMAO... I feel your pain, I just did a boost upgrade on windows for vc9 and 10 and it took toooooo much space. Still need to setup the gcc lib setup.
I'm avoiding it.
 
11:00 PM
QuantLib appears to be building. Time to go home and have a beer. Good night @Andrie, @Thell, @AnyoneElse.
 
Good night.
 

« first day (688 days earlier)      last day (2487 days later) »