Coder Social home page Coder Social logo

sinkr's Introduction

License: GPL v3 Build Status GitHub release

sinkr: Collection of functions with emphasis in multivariate data analysis.

To install (using devtools):

library(devtools)
install_github("marchtaylor/sinkr")

To cite:

citation("sinkr") 

sinkr's People

Contributors

marchtaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sinkr's Issues

newLonLat testing

newLonLat seems to give strange values when crossing the antimeridian. Needs to be tested in detail.

Wold cross-validation

Incorporate Wold cross-validation for PCA

Wold S (1978) Technometrics 20:397–405

chla_dineof <- sinkr::dineof(chla, delta.rms = DINEOF_PRECISION)

When running this line of code, a warning appears:
Warning messages:
1: In rm(list = c("Xa.best", "n.eof.best", "SVDi", "RECi")) :
object 'SVDi' not found
2: In rm(list = c("Xa.best", "n.eof.best", "SVDi", "RECi")) :
object 'RECi' not found

Does anyone have any idea?
Thanks

Question regarding bootstraping SVD

Hey! I'm trying to get bootstrap CI for EOFs and I'm looking at your code. I see that you sample the rows of the data, why is that? I'm trying to understand what would be the difference between sampling rows or columns.

Thanks!

Possible speed up improvement in fieldAnomaly

There might some benefit changing the way levs_lookup is created (example with daily data).

# Generate daily dates between 1948-01-01 and 2015-12-31
# i.e. 24837 dates
x <- as.POSIXlt(seq.Date(as.Date("1948-01-01"), as.Date("2015-12-31"), by="day"))

level="daily"

if(level=="daily"){levs=unique(x$yday)}

levs_lookup_1=vector("list", length(levs))
names(levs_lookup_1) <- levs

system.time(
  for(i in 1:length(levs)){
    if(level=="daily"){levs_lookup_1[[i]] <- which(x$yday == names(levs_lookup_1[i]))}
  }
)

# user  system elapsed 
#1.804   0.008   1.812 

system.time(
  levs_lookup_2 <- lapply(0:365, function(x,y) which(y == x), x$yday)
)
# user  system elapsed 
#0.068   0.004   0.072 
names(levs_lookup_2) <- levs

all.equal(levs_lookup_1, levs_lookup_2)
# [1] TRUE

getting negative values of eof over high rainfall zones

I'm doing EOF analysis over India using 'eof' function of your package.But I have obtained negative values of eof over high rainfall zones which is contradictory.
wpi-future-eof
In this figure you can see the red coloured zones in the western part which indicates lower eof values than other areas. But the western region (western ghat mountains of India)receives much higher rainfall than other areas. So,the picture should be opposite.

So, what's the problem in this function and how to solve it.

Thanks.

dineof method

Add argument to allow dineof to be run with svd instead of irlba - for use in small matrices

installing dependencies when default directory not writable

On certain R installations it may happen that the default R directory for libraries is not writable. In this case it would be helpful to ask if the user wants to specify another directory when installing dependencies.

For example when installing dependencies irgba and Rcpp:

Installing Rcpp
'/software/R-3.2.2/lib/R/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  '/tmp/RtmpCq7JLQ/devtools51753aa0ad41/Rcpp'  \
  --library='/write/protected/path/' --install-tests

Error: ERROR: no permission to install to directory '/write/protected/path/'

Currently the dependencies have to be added manually:

>install.packages("Rcpp")
Installing package into ‘/write/protected/path/’
(as ‘lib’ is unspecified)
Warning in install.packages("Rcpp") :
  'lib = "/write/protected/path/"' is not writable
Would you like to use a personal library instead?  (y/n) y

Argument x in northTest

Thanks for developing this package! I noticed the northTest function uses the second dimension of input argument "x" to determine the # of samples (for estimating error for each eigenvalue). However, for column-wise datasets, this method calculates the incorrect # of samples. Since that's the only place x is used, I suggest removing "x" as an argument and just directly requesting number of samples.

Error in `[<-.data.frame`(`*tmp*`, list, value = 0) : new columns would leave holes after existing columns

Hello!
Congratulations on your code, and thank you so much for sharing. I am an economics student trying to deal with gappy data, and your post and code have been more than useful; however, I am very new to using R, and I am getting this error trying to run the "dineof" function. I understand that has something to do with the data being a Dataframe, but transforming it into a matrix hasn't worked. Could you help me?

Issue with fieldAnonaly applied on daily data

I think the fieldAnomaly function is not correct for daily dataset.

# Generating daily dates between 1983-01-01 and 1984-12-31
# with a leap year (1984)

x <- as.POSIXlt(seq.Date(as.Date("1983-01-01"), as.Date("1984-12-31"), by="day"))

level="daily"
if(level=="daily"){levs=unique(x$yday)}

levs_lookup=vector("list", length(levs))
names(levs_lookup) <- levs
for(i in 1:length(levs)){
  if(level=="daily"){levs_lookup[[i]] <- which(x$yday == names(levs_lookup[i]))}
}

Here is the problem. For the same index (60), we get different dates:

j <- 60
x[levs_lookup[[j]]]
# [1] "1983-03-01 UTC" "1984-02-29 UTC"

And here, only December 31st, 1984

j <- 366
x[levs_lookup[[j]]]
# [1] "1984-12-31 UTC"

DINEOF to Satellite-Derived Chlorophyll-a

Hello,

First of all, congratulations for the package, it is very useful for my work. I am a biologist, I work with chlorophyll concentration.

The question: Use the DINEOF function to populate a time series of satellite images of chlorophyll concentration. The process works fine. However, I noticed that if I ran it again, it does so by returning a different EOF number than previously (as if it were randomly chosen).
I think this happens when you don't specify any argument to execute the function (specifically the "ref.pos" argument, which chooses it at random).
I don't know how to determine "ref.pos" with vector of non-gap reference positions. How should I determine the " n.max" (EOF numbers that the DINEOF method should use) and the "ref.pos"?

On the other hand, I understand that the lower the value of "delta.rms" the better the resolution of the interpolation: am I correct? What is the minimum value for "delta.rms" that can be chosen?

Thank you very much for your help, regards, Martin.

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.