Giter VIP home page Giter VIP logo

doc's People

Contributors

russel88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

doc's Issues

Fns values differ from matlab

Hi,

I was working with your functions trying to find why Fns value from DOC function differ from matlab. In my case, matlab gives a fns = 0.90494, while a summary of fns from DOC function
Fns Data
Min. :0.0004263 Real:200
1st Qu.:0.0622336
Median :0.0901535
Mean :0.0933056
3rd Qu.:0.1154092
Max. :0.7046036

I think that the mistake is in the DOC.boot function at ## Detect negative slope section. If I change point <- which(slope>0) to point <- which.max(slope>0) it almost mimic the matlab, because I obtain a fns = 0.9407. This change tries to do the same that the find(LocalSlope>0,1,'last')), which, if I am not wrong, should pick the last value (or max in R notation).
I run R with a set.seed(100), and run doc<-DOC(otus,R=200), and then:
xs <- seq(0,1,by=0.001)

Lowess

LOW <- loess(rJSD~Overlap,data=doc$DO,span=0.2,degree=1,family="symmetric",iterations=4,surface="interpolate")
LOW.P <- data.frame(predict(LOW,xs))

## Detect negative slope
# Smooth prediction
ma <- function(x,n=5){filter(x,rep(1/n,n), sides=2)}
low.ma <- ma(LOW.P[,1])
slope <- diff(low.ma)/diff(xs)
point <- which.max(slope>0) ### modified version
neg.slope <- xs[point[length(point)]]
    # Fns
Fns <- sum(doc$DO$Overlap>neg.slope,na.rm=T)/length(doc$DO$Overlap)

otus.txt

Discrepancies between Fns from plot and output of DOC function

Hi,

I am working with your function to do analysis like those proposed in Nature paper. In some cases Matlab needs to much time and I found that in R it can be done faster.
My problem is that I want a different figure than default plot. I run the function with
DOC_out<-DOC(otus,R=100,cores=24) and get the default plot with plot(DOC_out), which is attached. In that plot the median Fns is over 0.95, but if I run median(DOC_out$FNS[,1]) I get 0.8722449. I used a set.seed(100) in my R session.
I think that it is my fault but I cannot see what I am doing wrong, because as you state in this web page the vertical line is the median Fns value from bootstraps.
Another question is: default settings (not R or the number of cores) are the "correct" to "mimic" the original function? And how I should get the P values of original matlab code?

Thank you very much,

Manuel

otus.zip
default_plot

could not find function "lmer"

This error occured when I set cores > 1, because lme4 package could not loaded automatically in tasks. So I modified DOC.boot.R file in line53, as following:

llboot <- foreach(i = 1:R,.options.snow = opts, .packages = "lme4", .export = "mov.avg") %dopar% {

In which I added the .packages parameter, and It works.
Here's my R session info:
R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_4.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.