Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [r]

R is a language and environment for statistical computing and graphics that provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, ...) and graphical techniques and is highly extensible. (Questions about problems and bugs encountered when using R belong on the R-help mailing list (https://stat.ethz.ch/mailman/listinfo/r-help).)

-1
votes
0answers
16 views

Pseudo R2 value in R when removing missing values

I'm working with a logistic regression model in r model<- glm(response~ . , family= "binomial", data) and I'm using- DescTools::PseudoR2(model, which= "Nagelkerke") to get an estimate for model ...
3
votes
1answer
46 views

Numerical solving Lotka-Volterra ODE in R

Aim: I am trying to numerically solve a Lotka-Volterra ODE in R, using de sde.sim() function in the sde package. I would like to use the ...
-1
votes
1answer
26 views

R function or package for carrying out maximum likelihood techniques in random effect models

I am applying optim() function in R to obtain maximum likelihood estimates of the fixed effects and random effects in a model with bivariate random effects. The ...
0
votes
2answers
168 views

reading and processing large GRIB files

I'm trying to convert and process GrADS (grib) files into netcdf files. The files have values every 3 hours (2890 per year), 12 z levels, 120 variables, 241 columns and 236 rows. The data is almost 80 ...
6
votes
2answers
206 views

Recommended language/environment for large scale semi-continuous biological models

We have a fairly large (maybe 1000 equations) differential-algebraic equation model written in ACSLX, an obsolete modelling environment similar to Modelica. The model represents the evolution of a ...
1
vote
1answer
233 views

The difference between mkl_intel_lp64 vs mkl_gf_lp64 in a numerical reproducibility issue with Intel MKL

It has been discussed that Intel MKL can exhibit irreproducible behavior under certain conditions. In fact, this is a known thing and described by Intel as Conditional Numerical Reproducibility. A ...
1
vote
0answers
80 views

Is there a FEM package for R

I am looking for a R package that performs finite element analysis. Is there a fenics or equivalent FEM package for R?
0
votes
1answer
80 views

Sparse matrix inverse with reduced bandwidth

I have a sparse symmetric matrix of dimension 1393x1393 (8308 no zero elements), with bandwidth 1380. By Cuthill–McKee algorithm, I could achieve a new matrix with ...
1
vote
0answers
317 views

Pseudoinverse of a large sparse matrix in r

This question was moved from Cross-Validated: https://stats.stackexchange.com/questions/274042/pseudoinverse-of-large-sparse-matrix-in-r I am trying to calculate the pseudoinverse of a large sparse ...
2
votes
1answer
47 views

How to invert a lagrangian polynomial

I'm reading the following paper (Grezlak and Oosterlee) and I have a specific question to a sentence on page 5. I quote: "Since the mapping $y=g(x)$ is bijective and $g(x)$ is strictly increasing,...
1
vote
2answers
776 views

efficient way to compute lagrange polynomials

For two given vectors, not necessairly the same length, $x=(x_1,\dots,x_N)$ and $s=(s_1,\dots,s_M)$ I would like to compute the following term as efficiently as possible in R. For $j=1, \dots, N$ $$ ...
8
votes
0answers
138 views

Tucker factorisation to compare multiple PCA decompositions?

This is an entry-level question for multiway matrix decompositions. I have a set/population $k$ of entities (here biological cells) for each of which I also have a number ($l$) of flavours of length $...
1
vote
0answers
142 views

Problem in using N-BFGS-B in optim

I am a beginner user of R. I am trying to maximize log likelihood function with the bounded parameters. The function is a kind of gamma mixture model which try to ...
6
votes
0answers
135 views

Difference of convex functions optimization problem in R

I am seeking of any already written R package which could help in an optimization technique which is called Difference of convex functions. This technique is sketched here and could be very useful ...
5
votes
3answers
743 views

matrix storage, many rows or many columns?

tl;dr Should I store a matrix of Nx3 elements row-wise or column-wise, if I'm going to access 3 elements at a time? Does it matter? I'm setting up a numerical simulation with matrices of x,y,z ...
1
vote
0answers
640 views

How to adjust scikit-learn FactorAnalysis() settings to get scores output similar to one from factanal() in R?

I'm new to factor analysis and I need to compute factor scores using Python. I have R code to compute scores and I want to ...
0
votes
4answers
938 views

Easiest Way to Begin GPU Computing

What is the the simplest way to get started using GPU computing? My interests are primarily in neural networks and I would love to start using GPUs, but my time for learning GPU computing is very ...
2
votes
1answer
214 views

Monte Carlo Double Integration Implementation

Am implementing a monte carlo integration routine to compute this double integral in eqn 0.3 of page 2 of this paper 'Mobius energy of knots and unknots', Annals of Mathematics, http://www.math.ucsb....
3
votes
3answers
2k views

Is my Restricted (Natural) Cubic Spline equation wrong?

I am trying to fit a restricted cubic spline (natural cubic spline) with 4 knots to toy data, attempting to follow Hastie, Tibshirani, Friedman 2nd ed. 5.2.1 p.144-146, Eqs 5.4 and 5.5. Data: Is ...
1
vote
1answer
125 views

How we can implement the result of maximum principle in our numerical optimization algorithm?

I have an algorithm (in R) that maximizes a convex function on a compact convex set in every iteration. Based on the maximum principle, I know that the maximima are only attained on the boundary. But ...
1
vote
0answers
81 views

Package for integration over non-rectangular region

I want to compute the expected value of a multivariate function f(x) wrt to dirichlet distribution. My problem is "penta-nomial" (i.e 5 variables) so calculating ...
3
votes
1answer
3k views

Is R or Matlab currently faster?

The most up-to-date performance benchmarks comparison between R and Matlab that I could find are several years out of date: 1 2 Is anyone aware of a more up-to-date comparison?
0
votes
2answers
773 views

What is 'SOLVER' in R and Statistics/Analytics ?

**strong text**a) I tried to research on what exactly is a SOLVER only to find a not clear-cut simple answer. My doubts still remain after going through several sites full of discussions about it. I ...
0
votes
1answer
52 views

Signal balancing using SVD: notations and implementation in R

Hibbs et. al use SVD to balance the strength of different underlying signals in gene expression data using the following decomposition: $X_{m*n} = U_{m*n} \Sigma_{n*n} V^T_{n*n}$ In this case $U$ ...
2
votes
1answer
1k views

How do I simultaneously minimize two different functions who have the same inputs?

I want to minimize two different functions simultaneously who have the same inputs. The functions are both linear and non-exponential. $$F_1(X_1, X_2) = a_1X_1 + a_2X_2$$ $$F_2(X_1, X_2) = b_1X_1 + ...
1
vote
1answer
980 views

computing the inverse of a large block diagonal sparse matrix in r

I would like to compute the inverse of some large block diagonal sparse matrix. The number of rows and columns is somewhat over 50,000. The blocks are 12 by 12 and are sparse (27 non zero elements). ...
1
vote
1answer
140 views

what went wrong with my logistic regression implementation in c++?

I have implemented a simple logistic regression function with IRLS algorithm using the armadillo linear algebra libray ...
2
votes
3answers
311 views

R/C/C++ library for N-dimensional arrays

I'm looking for a library that is either in R or easily wrappable with R, that can do the following things: construct and subset N-dimensional arrays perform operations such as ...
0
votes
1answer
16k views

why Lapack routine dgesv doesn't solve this?

Suppose I have the following 3 by 3 matrix: p<-3 X<-matrix(1/p,p,p) --$\pmb X$ is just a $p$ by $p$ matrix where every entry is $1/p$. Now I want to solve ...
0
votes
1answer
280 views

How could I implement this neural network in R? [closed]

In Establishing, versus maintaining, brain function: a neurocomputational model of cortical reorganisation after injury to the immature brain, Varier et al develop a neural network model of motor ...
7
votes
2answers
1k views

adaptive Gauss-Kronrod quadrature with vector-valued integrand

So I'm trying to implement a Gauss-Kronrod adaptive quadrature. That is, I want to calculate $$\int_a^b f(x) dx = \sum_i f(x_i) w_i$$ where f(x) is evaluated at multiple points at once for ...
3
votes
1answer
138 views

Constrained System / Combinatorial Problem

Let $x\in \mathbb{R}^{n}$, $Y\in \mathbb{R}^{mxn}$. We can then define: $row_{i}(Y)=$ $i^{th}$ row of $Y$ $column_{i}(Y)=$ $i^{th}$ column of $Y$ $x_{i}=i^{th}$ element of $x$ $sum(x)=$ sum of ...
-2
votes
1answer
76 views

R language - how to list variables in use [closed]

How can I generate a list of all the variables that have been assigned in an R language session?
3
votes
1answer
275 views

LU Decomposition with memory-mapped matrices

I have a ~4.12 Tb structured relatively-sparse matrix dataset (about 8% of the matrix entries are non-zero) that i want to apply an LU decomposition, however, given the size of it, loading it in ...
17
votes
4answers
2k views

For which statistical methods are GPUs faster than CPUs?

I have just installed a Nvidia GT660 graphic card on my desktop and, after some struggle, I manage to interface it with R. I have been playing with several R packages that use GPUs, especially ...
4
votes
3answers
5k views

How to avoid NaN in optim?

Suppose, I have a function and want to optimize it. But if I use optim() which gives warnings(). How can I avoid these warnings ...
1
vote
1answer
135 views

Calculating AIC (in R or any other statistical software)

I am trying to fit the log-log plot of the cumulative distribution of a network to one of three models: Exponential (EXP) ($P(k)\sim e^{-ak}$), Exponentially truncated power law (TRU) ($P(k)\sim k^{a-...
5
votes
3answers
3k views

Storing a large, sparse array for R and Python

I've been working in R but sometimes switching to python. I'd like a more inter-language portable way of storing a large array than a csv file. (The particular csv file I'm dealing with is about 10^6 ...
5
votes
1answer
141 views

complexity constants in median computations same as that of general quantiles?

I would like to know whether the constant in the time complexity of computing the median is different from that of computing general quantiles. In R for example: ...
-2
votes
1answer
2k views

How do you install a binary R package?

I need instructions on how to install a binary package in R.