search for: lp_alphai

Displaying 1 result from an estimated 1 matches for "lp_alphai".

2011 Dec 08
1
optimize()
Hi! I have a difficulty in the use of function optimize(). Could you help me? I want to maximize this function: ##### Logaritmo da distribui??o condicional de alpha[i] lp_alphai <- function(alphai, i, beta, tau, N){ t1 <- (N[i+1] - N[i])*log(alphai) t2 <- - (N[i+1] - N[i])*alphai*log(beta[i]) t3 <- (alphai - 1)*sum(log(times[(N[i] + 1):N[i+1]])) t4 <- - exp(alphai*(log(tau[i+1]) - log(beta[i]))) t5 <- 0 if(i > 1) t5 <- exp(alphai*(log(tau[i]) -...