R/optimise.copula.mi.R

Defines functions optimise.copula.mi

Documented in optimise.copula.mi

optimise.copula.mi <-
function(mis,distribution,interval=c(-10,5),npoints){
	
	#quadratic loss function
	loss.fun = function(c,mi,...){
		(mi-generate.patchwork.copula(c=exp(c),...,returnmi=TRUE)$mi)^2
	}
	
	cvals = sapply(mis,function(mi){optimize(loss.fun,interval=interval,p=distribution,mi=mi,bins=ncol(distribution),npoints=npoints)$minimum})
	return(exp(cvals))
}

Try the knnIndep package in your browser

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

knnIndep documentation built on May 29, 2017, 4:26 p.m.