Displaying 20 results from an estimated 3000 matches similar to: "Complex Matrix Exponentials."
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
2008 Nov 11
3
exponential of a matrix
Is the matrix exponential available in some package?
The cannonical reference is "Nineteen dubious ways to take the exponential of a matrix". (Love that title)
Terry T.
2009 Aug 09
1
Inaccuracy in svd() with R ubuntu package
On two laptops running 32-bit kubuntu, I have found that svd(), invoked
within R 2.9.1 as supplied with the current ubuntu package, returns very
incorrect results when presented with complex-valued input. One of the
laptops is a Dell D620, the other a MacBook Pro. I've also verified the
problem on a 32-bit desktop. On these same systems, R compiled from
source provides apparently
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
>
2004 Nov 05
0
R check passes code and docs that don't match
I have code and documentation that don't match, but R CMD check didn't
flag it.
in mspath.R
mspath <- function(formula, # formula with observed Markov states
~ observation times (required)
qmatrix, # matrix of 1s and 0s with indices of
allowed transitions (diagonal is ignored) (required)
misc = FALSE,
ematrix = NULL, # matrix
2016 Mar 18
1
formatting of complex matrix
While working on the printing code, my colleague Zbyn?k ?lajchrt noticed that complex matrixes are sometimes misaligned:
> { matrix(1i,2,13) }
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i
[2,] 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i 0+1i
(the values in the last four columns
2005 Jul 11
1
Sweave and complex numbers
Hi
When using Sweave, most of my functions get called with complex
arguments.
They get typeset in with additions that I don't want; "1+1i" appears
as "1 + (0 + 1i)"
and I would rather have plain old "1+1i".
Example follows:
\documentclass[a4paper]{article}
\title{A Test File}
\author{Robin Hankin}
\usepackage{a4wide}
\begin{document}
\maketitle
A
2014 Jul 14
2
cummax / cummin for complex numbers
Dear all,
in R 3.1.0, this is happening:
> cummin(c(1+1i,2-3i,4+5i))
Error in cummin(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) :
'cummax' not defined for complex numbers
> cummax(c(1+1i,2-3i,4+5i))
Error in cummax(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) :
'cummin' not defined for complex numbers
It may be fixed in R-devel, but I thought I'd mention it to make sure
2023 Nov 05
2
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
This is another follow-up to the thread from September "Recent changes to
as.complex(NA_real_)".
A test in data.table was broken by the changes for NA coercion to complex;
the breakage essentially comes from
c(NA, 0+1i)
# vs
c(as.complex(NA), 0+1i)
The former is the output we tested against; the latter is essentially (via
coerceVector() in C) what's generated by our
2023 Nov 06
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
>>>>> Michael Chirico
>>>>> on Sun, 5 Nov 2023 09:41:42 -0800 writes:
> This is another follow-up to the thread from September
> "Recent changes to as.complex(NA_real_)".
> A test in data.table was broken by the changes for NA
> coercion to complex; the breakage essentially comes from
> c(NA, 0+1i)
> # vs
2023 Nov 06
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
Hmm, it is not actually at odds with help(c), it is just that the autocoercion works different that it used to, so that
as.complex(NA) == as.complex(NA_real) == NA_real_+0i)
which now differs from
NA_complex
although both print as NA.
I haven't been quite alert when this change was discussed, but it does look a bit unfortunate that usage patterns like c(NA, 0+1i) does not give complex NA
2023 Nov 08
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
So, to summarize, the open questions are:
(1) Should as.complex(NA_character_) give complex(r=NA_real_, i=0)
instead of NA_complex_?
(2) Should the first argument in c(NA, x) and c(NA_integer_, x),
where typeof(x) == "complex", be promoted to complex(r=NA_real_, i=0)
instead of NA_complex_?
My opinions:
(1) No. The imaginary part of the
2023 Nov 09
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
>>>>> Mikael Jagan
>>>>> on Wed, 8 Nov 2023 11:13:18 -0500 writes:
> So, to summarize, the open questions are:
> (1) Should as.complex(NA_character_) give complex(r=NA_real_, i=0)
> instead of NA_complex_?
> (2) Should the first argument in c(NA, x) and c(NA_integer_, x),
> where typeof(x) == "complex", be promoted
2023 Nov 07
1
c(NA, 0+1i) not the same as c(as.complex(NA), 0+1i)?
Thanks Martin. My hang-up was not on what the outcome of as.complex(NA)
should be, but rather, how I should read code like c(x, y) generally. Till
now, I have thought of it like 'c(x, y)' is c(as(x, typeof(y)), y)` when
"type(y) > type(x)". Basically in my mind, "coercion" in R <->
as.<newtype>(.) (or coerceVector() in C).
So I tracked down the source
2008 Jul 30
2
Sampling two exponentials
Hi all,
I am going to sample two variables from two exponential distributions, but I want to specify a covariance structure between these two variables. Is there any way to do it in R? Or is there a "Multivariate Exponential" thing corresponding to the multivariate normal? Thanks in advance.
Sincerely,
Yanwei Zhang
Department of Actuarial Research and Modeling
Munich Re America
Tel:
2012 Dec 16
1
nls for sum of exponentials
Hi there,
I am trying to fit the following model with a sum of exponentials -
y ~ Ae^(-md) + B e^(-nd) + c
the model has 5 parameters A, b, m, n, c
I am using nls to fit the data and I am using DEoptim package to pick the
most optimal start values -
fm4 <- function(x) x[1] + x[2]*exp(x[3] * -dist) + x[4]*exp(x[5] * -dist)
fm5 <- function(x) sum((wcorr-fm4(x))^2)
fm6 <- DEoptim(fm5,
2010 Mar 31
2
Should as.complex(NaN) -> NA?
I'm having trouble grokking complex NaN's.
This first set examples using complex(re=NaN,im=NaN)
give what I expect
> Re(complex(re=NaN, im=NaN))
[1] NaN
> Im(complex(re=NaN, im=NaN))
[1] NaN
> Arg(complex(re=NaN, im=NaN))
[1] NaN
> Mod(complex(re=NaN, im=NaN))
[1] NaN
> abs(complex(re=NaN, im=NaN))
[1] NaN
and so do the following
> Re(complex(re=1,
2005 Feb 16
3
real and complex vectors
The following caught me off-guard:
R> z <- 1i + 1:10
R> z <- Re(z)
R> z
[1] 1 2 3 4 5 6 7 8 9 10
as expected. But look:
R> z <- 1i + 1:10
R> make.real <- abs(z) < 1000
R> z[make.real] <- Re(z[make.real])
R> z
[1] 1+0i 2+0i 3+0i 4+0i 5+0i 6+0i 7+0i 8+0i 9+0i 10+0i
R>
didn't make z a real vector, which is what I wanted.
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
2013 Jun 18
1
eigen(symmetric=TRUE) for complex matrices
R-3.0.1 rev 62743, binary downloaded from CRAN just now; macosx 10.8.3
Hello,
eigen(symmetric=TRUE) behaves strangely when given complex matrices.
The following two lines define 'A', a 100x100 (real) symmetric matrix
which theoretical considerations [Bochner's theorem] show to be positive
definite:
jj <- matrix(0,100,100)
A <- exp(-0.1*(row(jj)-col(jj))^2)
A's being