Displaying 4 results from an estimated 4 matches for "bstar".
Did you mean:
star
2009 Apr 23
2
Two 3D cones in one graph
...t;-matrix(c(0.5,0.1,0.1,0.25),byrow=TRUE,nrow=2)
G<-eigen(Sigma)
E1<-t(G$vector%*%t(A))
E2<-t(diag(sqrt(G$values))%*%t(E1))
mu<-c(0.1,0.2)
E3<-sweep(E2,2,-mu)
a<-sqrt(max(rowSums(sweep(E3,2,mu)**2)))
b<-sqrt(min(rowSums(sweep(E3,2,mu)**2)))
astar<-as.numeric(a+abs(mu[1]))
bstar<-as.numeric(b+abs(mu[2]))
xstar<-seq(-astar,astar,len=50)
ystar<-seq(-bstar,bstar,len=50)
g<-expand.grid(x=xstar,y=ystar)
p1<-2*g$x*mu[1]/a**2+2*g$y*mu[2]/b**2
p2<-(g$x**2/a**2+g$y**2/b**2)
p3<-mu[1]**2/a**2+mu[2]**2/b**2-1
q<-(p1+sqrt(p1**2-4*p2*p3))/(2*p2)
z<-sqrt(1...
2012 Sep 17
2
Problem with Stationary Bootstrap
Dear R experts,
I'm running the following stationary bootstrap programming to find the parameters estimate of a linear model:
X<-runif(10,0,10)
Y<-2+3*X
a<-data.frame(X,Y)
coef<-function(fit){
fit <- lm(Y~X,data=a)
return(coef(fit))
}
result<- tsboot(a,statistic=coef(fit),R = 10,n.sim = NROW(a),sim = "geom",orig.t = TRUE)
Unfortunately, I got this
2007 Oct 31
1
Simple Umacs example help..
...le MH samplers using a simple linear regression
with 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)
}
samp...
2009 Jul 17
6
Solving two nonlinear equations with two knowns
Dear R users,
I have two nonlinear equations, f1(x1,x2)=0 and f2(x1,x2)=0. I try to use optim command by minimize f1^2+f2^2 to find x1 and x2. I found the optimal solution changes when I change initial values. How to solve this?
BTW, I also try to use grid searching. But I have no information on ranges of x1 and x2, respectively.
Any suggestion to solve this question?
Thanks,
Kate