Tarskin
2013-Jan-26 12:09 UTC
[R] Attempting to confirm a program i wrote in C (normalize 2 datasets, transform into histogram, transform into CDF, perform KS test)
I have written a program in C that two xy datasets, aligns these 2 datasets based on shared features, transforms them into equal sized histograms, transforms the histograms into cumulative distribution functions (via GSL) and finally performs a KS_test. I am wanting to validate my program's results and figure'd i would use R but i am kinda stuck at ithe histograms (I have 2 histogram objects with the same #bins, weighted by the Y value) right now and not really sure how to transform these into CDF to perform a KS.test, I looked at the edf function but got kind of lost. I realize this is most likely a very basic question but I am just not that familiar with R :( Thanks in advanc -- View this message in context: r.789695.n4.nabble.com/Attempting-to-confirm-a-program-i-wrote-in-C-normalize-2-datasets-transform-into-histogram-transform-tp4656704.html Sent from the R help mailing list archive at Nabble.com.
Jeff Newmiller
2013-Jan-26 15:59 UTC
[R] Attempting to confirm a program i wrote in C (normalize 2 datasets, transform into histogram, transform into CDF, perform KS test)
It is generally expected that the questioner pose a specific example so the respondent can have some assurance they are answering the actual question. In this case please provide a test data set, intermediate results, and final result generated by your C program. It would also show that you made a reasonable effort if you showed what steps you tried in R and where you think they went wrong. stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Tarskin <b.c.jansen at lumc.nl> wrote:>I have written a program in C that two xy datasets, aligns these 2 >datasets >based on shared features, transforms them into equal sized histograms, >transforms the histograms into cumulative distribution functions (via >GSL) >and finally performs a KS_test. > >I am wanting to validate my program's results and figure'd i would use >R but >i am kinda stuck at ithe histograms (I have 2 histogram objects with >the >same #bins, weighted by the Y value) right now and not really sure how >to >transform these into CDF to perform a KS.test, I looked at the edf >function >but got kind of lost. > >I realize this is most likely a very basic question but I am just not >that >familiar with R :( > >Thanks in advanc > > > >-- >View this message in context: >r.789695.n4.nabble.com/Attempting-to-confirm-a-program-i-wrote-in-C-normalize-2-datasets-transform-into-histogram-transform-tp4656704.html >Sent from the R help mailing list archive at Nabble.com. > >______________________________________________ >R-help at r-project.org mailing list >stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.