Displaying 20 results from an estimated 1000 matches similar to: "exponential of a matrix"
2005 Aug 17
2
power of a matrix
Dear all,
I have a population with three age-classes, at time t=0 the population
is:
n.zero <- c(1,0,0)
I have a transition matrix A which denotes "fertility" and "survival":
A <- matrix(c(0,1,5, 0.3,0,0, 0,0.5,0), ncol=3, byrow=TRUE)
To obtain the population at t=1, I calculate:
A %*% n.zero
To obtain the population t=2, I calculate:
A %*% (A %*% n.zero)
... and so
2007 May 06
7
A function for raising a matrix to a power?
Hi,
Is there a function for raising a matrix to a power? For example if you like to compute A%*%A%*%A, is there an abbreviation similar to A^3?
Atte Tenkanen
> A=rbind(c(1,1),c(-1,-2))
> A
[,1] [,2]
[1,] 1 1
[2,] -1 -2
> A^3
[,1] [,2]
[1,] 1 1
[2,] -1 -8
But:
> A%*%A%*%A
[,1] [,2]
[1,] 1 2
[2,] -2 -5
2002 Oct 09
3
Multiplication of Matrices
Hi,
Suppose I have a matrix, A. Is there an easy way to find A^{n}?
I mean, I can do something like:
A %*% A %*% A %*% A
for A^4, but if I want A^{10} it would be kind of annoying...
Cheers,
Kevin
------------------------------------------------------------------------------
Ko-Kang Kevin Wang
Postgraduate PGDipSci Student
Department of Statistics
University of Auckland
New Zealand
2006 Jan 28
1
Complex Matrix Exponentials.
Hello,
I was curious if there was a complex valued matrix exponential function
available for R? I have some Laplace transforms of occupation times
for a hidden Markov model. The matrix exponential function in the msm
package does not seem to handle complex values. For example
> MatrixExp(diag(1i,2))
[,1] [,2]
[1,] 1 0
[2,] 0 1
Warning message:
imaginary parts
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
2005 Aug 19
2
Handling dates
I have a problem with some functions handling dates, in packages 'date' and
'survival' (they seem to be identical). For instance, from the documentation,
--------------------
mdy.date {survival}
R Documentation
Convert to Julian Dates
Description
Given a month, day, and year, returns the number of days since January 1, 1960.
Usage
mdy.date(month, day, year, nineteen = TRUE,
2009 Jul 31
1
Matrix Integral
Hi,
Any help on this would be appreciated:
I need to integrate where K is a 4x4 matrix, and SIGMA is a 4x4 matrix from
say a to b, i.e. 0 to 5:
integral MatrixExp(-K * s) %*% SIGMA %*% t(SIGMA) %*% MatrixExp(t(-K) s) ds
t is tranpose , %*% : matrix mult , MatrixExp : matrix exponential
I've use integrate before on univariate functions like f(x) = x^2 which is
fine but when doing this on
2004 Jan 20
4
matrix exponential: M^0
> -----Original Message-----
> From: Federico Calboli
> Sent: Tuesday, January 20, 2004 5:40 PM
> To: r-help
> Subject: [R] matrix exponential: M^0
>
> I would like to ask why the zeroeth power of a matrix gives me a matrix
> of ones rather than the identity matrix:
>
> > D<-rbind(c(0,0,0),c(0,0,0),c(0,0,0))
> > D<-as.matrix(D)
> > D
>
2000 Jul 31
1
find canonic host name
I am concerned about the code under the comment
/* Find canonic host name. */
in ssh.c. This replaces the hostname entered by the user with the
cannonical name determined by getaddrinfo, causing the new name to
be used henceforth. This includes connecting to the host, and
finding its public key in a known_hosts file.
getaddrinfo seems (on Debian GNU/Linux 2.2, GNU libc 2.1.3) to look
up
2009 Oct 01
2
matrix exponential
Hi Guys,
Im trying to find the exponential of a matrix.
Can someone please help me do this?
Thanks a lot
_________________________________________________________________
View photos of singles in your area Click Here
=1&lage=18&uage=55&cl=14&sl=0&dist=50&po=1&do=2&trackingid=1046138&r2s=1&_t=773166090&_r=WLM_EndText
2009 Sep 21
2
Combine vectors in order to form matrixes with combn
Hello!
I've a problem with the combn function and a set of vector. I
would like to make a simple combination where, instead of scalars, i
would like to combine vector, in order to form matrixes.
In other
words, i have nineteen 6-items vectors (for example coef1-coef19), that
i would like to combine in n!/k!(n-k)! 6x6 matrixes.
I tried with a
code like this
mma <-
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}
2001 Apr 09
1
Support for compartment models / matrix exponential method
I try to fit reaction kinetic data to a given hypothetical model
consisting of 3 ODEs. After some reading in Bates/Watts and the literature
cited there (e.g. Jennrich/Bright) I looked in R for functions that support
the use of the matrix exponential method. Until now I used for a similar
(but simpler) problem the nls package and fitted against the the parameterized
solution function. But this
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
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
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
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]
2008 Mar 12
3
net join fails NT_STATUS_INVALID_COMPUTER_NAME
We want to join out Linux-Server:
SLES 10 SP1 x86 with Samba (samba-client-3.0.24-2.23)
to our W2000 Domain.
so i use the command:
net join -S TQ-NET.DE -UAdministrator
and i get the following Errormessage:
Failed to join domain!
ADS join did not work, falling back to RPC...
[2008/03/12 12:07:29, 0] utils/net_rpc_join.c:net_rpc_join_newstyle(350)
Error in domain join verification
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
2008 Feb 18
4
newbie (me) needs to model distribution as two overlapping gaussians
Recently, I have been working with some data that look like two overlapping gaussian distributions. I would like to either
1) determine the mean and SD for each of the two distributions
OR
2) get some (bayesian ?) statistic that estimates how likely an observation is to belong to the left-hand or right-hand distribution
In case I'm using the wrong language, my data looks something like