R/spm_expm2.R

Defines functions spm_expm2

spm_expm2 <-
function(J,x){
    x0 <- x
    fx <- (J)%*%x
    j  <- 1

	#while (eigen2(tcrossprod(fx))$values[1] > 1e-16){
#while (spm_eigen(tcrossprod(fx))[NROW(fx)] > 1e-16){
    while (eigen(tcrossprod(fx))$values[1] > 1e-16){
 	j  <- j + 1
	x  <- x + fx
	fx <- (J)%*%fx/j

  	if

	#(eigen2(tcrossprod(x))$values[1] > 1e16){
	#(spm_eigen(tcrossprod(x))[NROW(x)] > 1e16){
	(eigen(tcrossprod(x))$values[1] > 1e16){
	x <- spm_expm1((J))%*%x0}
	}
    x
    }

Try the FIAR package in your browser

Any scripts or data that you put into this service are public.

FIAR documentation built on June 5, 2018, 5:03 p.m.