Displaying 1 result from an estimated 1 matches for "densityfunct".
2012 May 09
0
Error in outer() : dimension mismatch
...Error: outer(par1, par2, y1, y2, FUN = function.subplot, KERNEL = KERNEL,:
dims [product 25921] [1] does not match the length of the object.
par1 <- seq(-3,3,0.1)
par2<- seq(-3,3,0.1)
x<-cbind(par1,par2) # par1:parameter1,
par2: parameter2, sigma is the third parameter that I fix
densityfunction <- function(x, y1,y2, sigma=0.2){ # y1 and y2: the data
x <- matrix(x, nrow = 1)
function.value <- 0
for (i in 1:T){ # T: the length of the data
k <- y1[i] - x[,2]*y2[i] - (1-x[,2])*x[,1]
kk <- t(k)%*%k
density <- -((T+2)/2)*log...