Displaying 20 results from an estimated 500 matches similar to: "expm()"
2007 Mar 15
1
expm() within the Matrix package
Hi
Could anybody give me a bit of advice on some code I'm having trouble with?
I've been trying to calculate the loglikelihood of a function iterated over
a data of time values and I seem to be experiencing difficulty when I use
the function expm(). Here's an example of what I am trying to do
y<-c(5,10) #vector of 2 survival times
p<-Matrix(c(1,0),1,2) #1x2 matrix
2007 Mar 06
2
Estimating parameters of 2 phase Coxian using optim
Hi,
My name is Laura. I'm a PhD student at Queen's University Belfast and have
just started learning R. I was wondering if somebody could help me to see
where I am going wrong in my code for estimating the parameters [mu1, mu2,
lambda1] of a 2-phase Coxian Distribution.
cox2.lik<-function(theta, y){
mu1<-theta[1]
mu2<-theta[2]
lambda1<-theta[3]
2011 Aug 17
2
An example of very slow computation
This message is about a curious difference in timing between two ways of computing the
same function. One uses expm, so is expected to be a bit slower, but "a bit" turned out to
be a factor of >1000. The code is below. We would be grateful if anyone can point out any
egregious bad practice in our code, or enlighten us on why one approach is so much slower
than the other. The problem
2017 Feb 09
2
R CMD check error
Martyn,
No, that didn't work.
One other thing in the mix (which I don't think is the issue) is that I call one of the
C-entry points of expm. So the DESCRIPTION file imports expm, the NAMESPACE file imports
expm, and the init.c file is
#include "R.h"
#include "R_ext/Rdynload.h"
/* Interface to expm package. */
typedef enum {Ward_2, Ward_1, Ward_buggy_octave}
2011 Apr 14
2
Krylov subspace computations of matrix exponentials
I use the very nice expm functions available from the expm and Matrix
packages. My understanding is that for large sparse matrices the
currently best methods available are Krylov subspace methods, but
they are as far as I can tell not implemented in either of the packages
mentioned, nor in any other R package I have found.
Does anybody know if Krylov subspace methods are available from
any R
2017 Feb 09
2
R CMD check error
Martin,
I am aware of --vanilla; I use it myself for some testing. In this case R_LIBS_USER was
set externally (part of my login) and does not involve any of the R scripts. That means
it is inherited by any subprocess. For example:
tmt1495% R --vanilla --no-environ
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
2017 Feb 08
2
R CMD check error
I have a local library which depends on the expm library. The expm library is loaded into
my personal space and I have the environment variable R_LIBS_USER set appropriately. The
command "library(expm)" works just fine from the command line, and in fact the package
works if I do the source() and dyn.load() commands by hand.
The following sequence works:
tmt% R CMD build
2017 May 09
2
registering Fortran routines in R packages
Dear list,
I?m trying to register Fortran routines in randtoolbox (in srt/init.c file), see https://r-forge.r-project.org/scm/viewvc.php/pkg/randtoolbox/src/init.c?view=markup&root=rmetrics.
Reading https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines and looking at what is done in stats package, I first thought that the following code will do the job:
2009 Nov 23
1
R: Re: chol( neg.def.matrix ) WAS: Re: Choleski and Choleski with pivoting of matrix fails
It works! But Once I have the square root of this matrix, how do I convert it
to a real (not imaginary) matrix which has the same property? Is that
possible?
Best,
Simon
>----Messaggio originale----
>Da: p.dalgaard at biostat.ku.dk
>Data: 21-nov-2009 18.56
>A: "Charles C. Berry"<cberry at tajo.ucsd.edu>
>Cc: "simona.racioppi at
2011 Sep 22
1
Error in as.vector(data) optim() / fkf()
Dear R users,
When running the program below I receive the following error message:
fit <- optim(parm, objective, yt = tyield, hessian = TRUE)
Error in as.vector(data) :
no method for coercing this S4 class to a vector
I can't figure out what the problem is exactly. I imagine that it has
something to do with "tyield" being a matrix. Any help on explaining what's
going on
2020 Apr 17
1
Demo for linking native routines between R packages
Dear Davis and Dirk,
Thank you very much for the suggestions, which are very valuable and
helpful.
I will add references to prior examples, document my project with the clear
step-by-step-style document of Davis's project, and come back again to the
mailing list.
Best wishes,
David
On Fri, Apr 17, 2020 at 3:40 PM Dirk Eddelbuettel <edd at debian.org> wrote:
>
> Jitao,
>
2020 Aug 10
4
Rebuild against FlexiBLAS
Hi,
R has been built against FlexiBLAS in rawhide [1, 2]. These are the R
packages that need to be rebuilt:
R-ape-0:5.4-2.fc33.x86_64
R-expm-0:0.999.4-7.fc33.x86_64
R-gee-0:4.13.20-4.fc33.x86_64
R-gss-0:2.2.2-3.fc33.x86_64
R-igraph-0:1.2.5-3.fc33.x86_64
R-msm-0:1.6.8-5.fc33.x86_64
R-preprocessCore-0:1.50.0-4.fc33.x86_64
R-qtl-0:1.46.2-4.fc33.x86_64
R-quadprog-0:1.5.8-5.fc33.x86_64
Could
2009 Nov 25
1
R: Re: R: Re: chol( neg.def.matrix ) WAS: Re: Choleski and Choleski with pivoting of matrix fails
Dear Peter,
thank you very much for your answer.
My problem is that I need to calculate the following quantity:
solve(chol(A)%*%Y)
Y is a 3*3 diagonal matrix and A is a 3*3 matrix. Unfortunately one
eigenvalue of A is negative. I can anyway take the square root of A but when I
multiply it by Y, the imaginary part of the square root of A is dropped, and I
do not get the right answer.
I tried
2006 Sep 07
2
Matrix package in R-2.4.0alpha
In a newly downloaded version (today) of R-2-4-0alpha, with all packages
from CRAN also installed today, I get:
> library(Matrix)
Erro en loadNamespace(package, c(which.lib.loc, lib.loc), keep.source =
keep.source) :
in 'Matrix' methods specified for export, but none defined: BIC,
anova, coef, confint, deviance, fitted, fixef, formula, head, lmer, logLik,
mcmcsamp, plot,
2017 Feb 10
0
R CMD check error (interfacing to C API of other pkg)
>>>>> Therneau, Terry M , Ph D <therneau at mayo.edu>
>>>>> on Thu, 9 Feb 2017 12:56:17 -0600 writes:
> Martyn,
> No, that didn't work.
> One other thing in the mix (which I don't think is the issue) is that I call one of the
> C-entry points of expm. So the DESCRIPTION file imports expm, the NAMESPACE file imports
2006 Dec 10
1
Problem with loading "library(Matrix)" at Ubuntu
Dear All,
After upgrading to R-2.4.0-dapper2 (my system is ubuntu 6.06 LTS), I often
met problems when loading some packages like Matrix.
Here is the details:
> library(Matrix)
Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source =
keep.source) :
in 'Matrix' methods specified for export, but none defined: Arith,
Math, Math2, +, %*%, Schur, as.matrix, chol,
2017 Nov 20
2
package check fail on Windows-release only?
I mistakenly left a write in "/tmp" in the rockchalk package (version
1.8.109) that I uploaded last Friday. Kurt H wrote and asked me to fix
today.
While uploading a new one, I became aware of a problem I had not seen.
The version I uploaded last Friday, 1.8.109, has OK status on all
platforms except r-release-windows-ix86+x86_64. I get OK on
oldrel-windows and also on devel-windows.
2006 Sep 21
2
Exponentiate a matrix
Suppose I have a square matrix P
P <- matrix(c(.3,.7, .7, .3), ncol=2)
I know that
> P * P
Returns the element by element product, whereas
> P%*%P
Returns the matrix product.
Now, P^2 also returns the element by element product. But, is there a
slick way to write
P %*% P %*% P
Obviously, P^3 does not return the result I expect.
Thanks,
Harold
[[alternative HTML version
2020 Sep 11
2
more Matrix weirdness
> > "These operators are also implicit S4 generics, but as
> > primitives, S4 methods will be dispatched only on S4
> > objects ?x?."
> Yes, exactly, very well found, Georgi!
I'm sorry Martin, but I don't understand your point here.
I'm assuming that you want the (S3) matrix, x, to be converted to an
(S4) Matrix.
However, this is not a
2018 Feb 27
2
scale.default gives an incorrect error message when is.numeric() fails on a sparse row matrix (dgeMatrix)
I am attempting to use the lars package with a sparse input feature matrix,
but the following fails:
library(Matrix)
library(lars)
data(diabetes)
attach(diabetes)
x = as(as.matrix(as.data.frame(x)), 'dgCMatrix')
lars(x, y, intercept = FALSE)
Error in scale.default(x, FALSE, normx) :
>
> length of 'scale' must equal the number of columns of 'x'
>
>
More