R/ssystem_set.R

Defines functions ssystem_set

ssystem_set <-
function(alpha,g,beta,h,TS)
#alpha,g,beta,h: The parameter of the S-system. See S-system function to get more details.
#TS: Time series data.
{

	G=matrix(data=rep(g,each=nrow(TS)),nrow=nrow(TS),ncol=length(g))#preparing g
	H=matrix(data=rep(h,each=nrow(TS)),nrow=nrow(TS),ncol=length(h))#preparing h

	ss=(alpha*apply(TS^G,1,FUN=prod)-beta*apply(TS^H,1,FUN=prod))#Calculating
	
	return(ss)
}

Try the SPEM package in your browser

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

SPEM documentation built on Nov. 8, 2020, 6:52 p.m.