Displaying 20 results from an estimated 500 matches similar to: "Solve an ordinary or generalized eigenvalue problem in R"
2012 Apr 19
3
Solve an ordinary or generalized eigenvalue problem in R?
Folks:
I'm trying to port some code from python over to R, and I'm running into a
wall finding R code that can solve a generalized eigenvalue problem
following this function model:
http://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eig.html
Any ideas? I don't want to call python from within R for various reasons,
I'd prefer a "native" R solution if one
2011 May 27
1
eigenvalues and correlation matrices
I'm trying to test if a correlation matrix is positive semidefinite.
My understanding is that a matrix is positive semidefinite if it is
Hermitian and all its eigenvalues are positive. The values in my
correlation matrix are real and the layout means that it is symmetric.
This seems to satisfy the Hermitian criterion so I figure that my real
challenge is to check if the eigenvalues are all
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
2003 Jul 03
2
SVD and spectral decompositions of a hermitian matrix
Hi:
I create a hermitian matrix and then perform its singular value
decomposition. But when I put it back, I don't get the original
hermitian matrix. I am having the same problem with spectral value
decomposition as well.
I am using R 1.7.0 on Windows. Here is my code:
X <- matrix(rnorm(16)+1i*rnorm(16),4)
X <- X + t(X)
X[upper.tri(X)] <- Conj(X[upper.tri(X)])
Y <-
2017 Dec 29
1
winbuilder warning message wrt function pointers
And remove the cast on the return value of R_GETCCallable. And check
that your function is found before using it.
#include <R.h>
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
void bdsmatrix_prod4(int nrow, int nblock, int *bsize,
double *bmat, double *rmat,
int nfrail, double *y) {
DL_FUNC fun = NULL;
if (fun==NULL)
2010 Jul 30
4
transpose of complex matrices in R
Hello everybody
When one is working with complex matrices, "transpose" very nearly
always means
*Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]).
One often writes A^* for the Hermitian transpose.
I have only once seen a "real-life" case
where transposition does not occur simultaneously with complex conjugation.
And I'm not 100% sure that that wasn't a
2017 Dec 29
0
winbuilder warning message wrt function pointers
You can legally cast a function pointer to another function pointer, where
the signatures differ. (It is not legal to cast between data and function
pointers.)
I would make typedefs for the various signatures, as the casting syntax is
more
readable then.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Dec 29, 2017 at 10:13 AM, Therneau, Terry M., Ph.D. <
therneau at mayo.edu> wrote:
2020 Sep 13
1
[cfe-dev] Phabricator -> GitHub PRs?
Fangrui Song via cfe-dev <cfe-dev at lists.llvm.org> writes:
>
> One property of "Squash and merge" is that it will add intermediate
> commits as bullet points (`* `). In many cases the merger does not spend
> more time cleaning up the description so a commit may look like:
>
> ```
> RFC: treat small negative λ as 0 for sqrt(::Hermitian) (#35057)
>
>
2008 Aug 05
1
Fix for nls bug???
Hi All,
I've hit a problem using nls. I think it may be a restriction in the
applicability of nls and I may have found a fix, but I've been wrong before.
This example is simplified to the essentials. My real application is much
more complicated.
Take a function of matrix 'x' with additional arguments:
matrix 'aMat' whose values are _not_ to be determined by nls
vector
2008 Jul 29
1
tensor product of equi-spaced B-splines in the unit square
Dear all,
I need to compute tensor product of B-spline defined over equi-spaced
break-points.
I wrote my own program (it works in a 2-dimensional setting)
library(splines)
# set the break-points
Knots = seq(-1,1,length=10)
# number of splines
M = (length(Knots)-4)^2
# short cut to splineDesign function
bspline = function(x) splineDesign(Knots,x,outer.ok = T)
# bivariate tensor product of
2007 Jun 23
1
Creating different matrices in a loop
Hello,
I have a big matrix of size (20,5) -bmat . I have to loop though the rows in
the matrix and create DIFFERENT matrices each time I go through the loop.
counts=c(4,6,10);
p=1;
for (i in 1:length(counts))
{
smat=bmat[p:p+i-1,];
p=p+i;
}
The problem is smat overwrites itself each time inside the loop. I would
like to have smat1, smat2, smat3 instead of a single vector smat.
2012 Jul 12
1
SVAR Restriction on AB-model
Hello!
I'm doing a svar and when I make the estimation the next error message
appears:
In SVAR(x, Amat = amat, Bmat = bmat, start = NULL, max.iter = 1000, :
The AB-model is just identified. No test possible.
Could you help me to interpret it please.
Also I have the identification assumption that one of my shocks is exogenous
relative to the contemporaneous values of the other variables
2017 Dec 29
3
winbuilder warning message wrt function pointers
I've recently updated the coxme package, which calls internal routines from the bdsmatrix
package.? (It is in fact mentioned as an example of this in the Extensions manual.)
The call connections are a blocks like this, one for each of the 9 called C routines.
void bdsmatrix_prod4(int nrow,??? int nblock,?? int *bsize,
??????????????????? double *bmat, double *rmat,
??????????????????? int
2009 Mar 05
3
methods package
I'm working on the next version of coxme, one step of which is converting
the bdsmatrix library from Splus to R. Actually, it is a conversion from
S4 methods as first described in the Green book to S4 methods as they
currently exist. Mostly it's going ok, but not entirely.
1. The biggest issue is lack of documentation. The online help pages have
not been a help; they keep saying
2017 Dec 29
0
winbuilder warning message wrt function pointers
Try changing
static void (*fun)() = NULL;
to
DL_FUNC fun = NULL;
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Dec 29, 2017 at 5:14 AM, Therneau, Terry M., Ph.D. <
therneau at mayo.edu> wrote:
> I've recently updated the coxme package, which calls internal routines
> from the bdsmatrix package. (It is in fact mentioned as an example of this
> in the Extensions
2002 Mar 05
1
Matrix identification bug (PR#1361)
Full_Name: Hao Yu
Version: 1.4.1
OS: Windws and Linux
Submission from: (NULL) (129.100.45.161)
Hi,
Recently we did some benchmarks regarding matrix inverse operation and found
some strange things. See the following results (the package Matrix is most
updated).
1. load the function Toeplitz and library(Matrix)
"Toeplitz"
function(x)
{
matrix(x[1 + abs(outer(seq(along = x),
2017 May 10
1
registering Fortran routines in R packages
Have you tried using tools:::package_native_routine_registration_skeleton()? If you don't like its output, you can easily edit its results and still avoid most pitfalls.
Cheers, Jari Oksanen
________________________________________
From: R-devel <r-devel-bounces at r-project.org> on behalf of Berend Hasselman <bhh at xs4all.nl>
Sent: 10 May 2017 09:48
To: Christophe Dutang
Cc:
2007 Nov 29
1
?eigen documentation suggestion
from ?eigen
symmetric: if 'TRUE', the matrix is assumed to be symmetric (or
Hermitian if complex) and only its lower triangle is used. If
'symmetric' is not specified, the matrix is inspected for
symmetry.
I think that could mislead a naive reader as it suggests that, with symmetric=TRUE,
the result of eigen() (vectors and values) depends only on
2020 Nov 10
1
one thing to check
Hi, Jim:
Could you please look at svd2.Rd and see what it says? It may give
an example, where it gave a better answer than svd -- i.e., a marginal
case, where svd2 honestly gave a better answer than svd.
If we find -- either in svd2.Rd or in one of the revdepchecks -- an
example where svd2 gives a demonstrably different answer, we need to
consider what to do about that.
1.
2009 Oct 12
1
Help Error
Hi R-users,
I would like to ask question related to error output.
If an error comments come out, then the program will automatically stop.
I want to ask , how I can still continue the program even though there is an error comment?
var=VAR(Canada,p=3,type="const")
for (j in 1:nrow(com))
{
mat=ma
{
for (i in 1:ncol(com))
{
y=which(mat==com[j,i])
mat[y]=NA
}