search for: sqdist

Displaying 5 results from an estimated 5 matches for "sqdist".

Did you mean: sdist
2007 Mar 12
2
Lmer Mcmc Summary and p values
...9 Treatment 4 -0.2483 0.8661 -0.287 0.774 Correlation of fixed effects Intra T2 T3 T2 -0.989 T3 -0.745 0.737 T4 -0.577 0.570 0.430 > The p-values from mcmc are: > mcmcpvalue<-function(samp) { std<-backsolve(chol(var(samp)), cbind(0,t(samp))-colMeans(samp), transpose=TRUE) sqdist<-colSums(std*std) sum(sqdist[-1]>sqdist[1]/nrow(samp) } fitSI<-mcmcsamp(fit,50000) library(coda) HPDinterval(fitSI) lower upper Intercept -4.0778905 -3.1366836 Treatment2 3.4455972 4.3196598 Treatment 3 0.399302 1.287747 Treatment 4 -1.7898933 -0.2980325 log...
2009 Feb 24
2
lmer, estimation of p-values and mcmcsamp
...t yet been successful. This is my code: lnmass <- lmer(log.mass ~ treatment + (1|block), data=exp1) summary(lnmass) samp <- rnorm(n=10000) mcmcpvalue <- function(samp) {std <- backsolve(chol(var(samp)), cbind(0,t(samp)) - colMeans(samp), transpose = TRUE) sqdist <- colSums(std*std) sum(sqdist[-1] > sqdist[1]/nrow(samp) } markov1 <- mcmcsamp(lnmass, 10000) HPDinterval(markov1) mcmcpvalue(as.matrix(markov1[,1])) mcmcpvalue(as.matrix(markov1[,2])) mcmcpvalue(as.matrix(markov1[,3])) mcmcpvalue(as.matrix(markov1[,4])) mcmcpvalue(as.matrix(markov...
2007 Feb 12
1
lmer and estimation of p-values: error with mcmcpvalue()
...How can I proceed in estimating the p-values, then? I very much acknowledge any suggestions. Best regards Christoph. ## mcmcpvalue <- function(samp) { std <- backsolve(chol(var(samp)), cbind(0, t(samp)) - colMeans(samp), transpose = TRUE) sqdist <- colSums(std * std) sum(sqdist[-1] > sqdist[1])/nrow(samp) } m1<-lmer(number_pollinators~logpatch+loghab+landscape_diversity+(1|site),quasipoisson) Generalized linear mixed model fit using Laplace Formula: number_pollinators ~ logpatch + loghab + landscape_diversity + (1 | si...
2007 Mar 13
1
lme4 and mcmcamp
...9 0.719 Treatment 4 -0.2483 0.8661 -0.287 0.774 Correlation of fixed effects Intra T2 T3 T2 -0.989 T3 -0.745 0.737 T4 -0.577 0.570 0.430 > The p-values from mcmc are: > mcmcpvalue<-function(samp) { std<-backsolve(chol(var(samp)), cbind(0,t(samp))-colMeans(samp), transpose=TRUE) sqdist<-colSums(std*std) sum(sqdist[-1]>sqdist[1]/nrow(samp) } fitSI<-mcmcsamp(fit,50000) library(coda) HPDinterval(fitSI) lower upper Intercept -4.0778905 -3.1366836 Treatment2 3.4455972 4.3196598 Treatment 3 0.399302 1.287747 Treatment 4 -1.7898933 -0.2980325 log(T...
2008 Sep 16
1
Spatial join – optimizing code
Hi, Few days ago I have asked about spatial join on the minimum distance between 2 sets of points with coordinates and attributes in 2 different data frames. Simon Knapp sent code to do it when calculating distance on a sphere using lat, long coordinates and I've change his code to use Euclidian distances since my data had UTM coordinates. Typically one data frame has around 30 000 points