Main Page | Report this Page
 
   
Science Forum Index  »  Statistics - Math Forum  »  Weighted Sampling Example? (MCMC)
Page 1 of 1    
Author Message
Robbie
Posted: Fri Mar 16, 2007 1:33 pm
Guest
Could someone point me toward an example of using MCMC with weighted
observations? Even a WinBugs sample would help me get off dead center
on this.

Many thanks,
Dave
Anon.
Posted: Fri Mar 16, 2007 2:54 pm
Guest
Robbie wrote:
Quote:
Could someone point me toward an example of using MCMC with weighted
observations? Even a WinBugs sample would help me get off dead center
on this.

Assuming a Gaussian response, the weights would go into the precision:


# Model
model {
for(i in 1:N) {
x[i] ~ dnorm(mu, tau[i])
tau[i] <- wt[i]*tau0
}
mu ~ dnorm(0,0.001)
tau0 ~ dgamma(0.01, 0.01) # May not be the best prior!
}

# Data
list(N=5, x=c(2,3,4,5,6), wt=c(1,1,4,2,7))

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: www.jnr-eeb.org
Robbie
Posted: Fri Mar 16, 2007 4:15 pm
Guest
On Mar 16, 1:54 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Quote:
Robbie wrote:
Could someone point me toward an example of using MCMC with weighted
observations? Even a WinBugs sample would help me get off dead center
on this.

Assuming a Gaussian response, the weights would go into the precision:

# Model
model {
for(i in 1:N) {
x[i] ~ dnorm(mu, tau[i])
tau[i] <- wt[i]*tau0
}
mu ~ dnorm(0,0.001)
tau0 ~ dgamma(0.01, 0.01) # May not be the best prior!

}

# Data
list(N=5, x=c(2,3,4,5,6), wt=c(1,1,4,2,7))

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB:www.jnr-eeb.org

Thanks Bob!
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Fri Aug 29, 2008 5:23 pm