search for: logalpha

Displaying 4 results from an estimated 4 matches for "logalpha".

2007 Oct 31
1
Simple Umacs example help..
...a Cauchy error term. x <- c(1.808,1.799,1.179,0.574,3.727,0.946,3.719,1.566,3.596,3.253) y <- c(1.816,1.281,-1.382,0.573,3.793,0.935,1.775,1.474,3.679,3.889) fn = function(x,a=0,b=1){ a+b*x } sample.ab <-function(x,y,a,b,s,da,db){ bstar = runif(1,b-db,b+db) astar = runif(1,a-da,a+da) logalpha = sum(dcauchy(y,location=fn(x,astar,bstar),scale=s,log=T) - dcauchy(y,location=fn(x,a,b),scale=s,log=T)) logu = log(runif(1,0,1)) acc = (logu < logalpha) b = acc*bstar + (1-acc)*b a = acc*astar + (1-acc)*a list(b=b,a=a,acc=acc) } samples = function(x,y,a,b,s,ds){ sstar = runif(1,s-ds,s+ds)...
2017 Nov 07
2
Using MLE on a somewhat unusual likelihood function
...list of starting values is too far from optimum but this is unlikely since I picked values close to where the parameters usually end up. I have also tried switching these around a bit. Here is the code: xhat = c(statemw-(1-alpha)*rval) survivalf <- function(x) {(1-plnorm(statemw,mean=mu,sd=logalpha))} wagefn <- function(lam, eta, alpha, xhat, mu, logalpha) { n=nrow(cpsdata2) wagevec = matrix(nrow=n,ncol=1) for (i in 1:n) { if (cpsdata2[i,2] > 0){ wagevec[i,] <- c(eta*lam*survivalf(statemw)*exp(-lam*survivalf(statemw)*cpsdata2[i,2,])) } else if (cpsdata2[i,1,]=...
2017 Nov 07
0
Using MLE on a somewhat unusual likelihood function
...r > from optimum but this is unlikely since I picked values close to where the > parameters usually end up. I have also tried switching these around a bit. > > Here is the code: > > xhat = c(statemw-(1-alpha)*rval) > survivalf <- function(x) {(1-plnorm(statemw,mean=mu,sd=logalpha))} > > wagefn <- function(lam, eta, alpha, xhat, mu, logalpha) { > n=nrow(cpsdata2) > wagevec = matrix(nrow=n,ncol=1) > for (i in 1:n) { > > if (cpsdata2[i,2] > 0){ > wagevec[i,] <- > c(eta*lam*survivalf(statemw)*exp(-lam*survivalf(statemw)*cpsdata...
2017 Feb 15
5
paquete Rcmdr y BiodiversityR
Estimados, Muchas gracias por sua ayuda, ya pude instalar data.table y esta funcionando. Respecto al paquete biodiversityR, no se porque ahora no me corre. El script esta correcto, pero no se porque me tira error. > fase<-diversitycomp(biobsp, y=biopcat,factor1="Fase",index="richness",method=?s") Error in diversitycomp(biobsp, y = biopcat, factor1 =