# Test Post

This is for testing various techniques:

Upload of an equation from a pdf converted to a jpg

Seems to work reasonably well. Now a slightly smaller png file:

Try WordPress latex:

Now redo the equation above:

$SSE = \sum\limits_{k = 1}^r {\sum\limits_{t = 1}^N {\left( {Y_k \left( t \right) - \alpha _k - \beta _k X\left( t \right)} \right)^2 } }$

Yes!! It works.

$BSI = .465 \cdot (1.000624)^{\left( {.99 + .914T} \right)^3 }$

${\rm F(x) = }\int\limits_{{\rm - }\infty }^{\rm x} {{\rm g(t)h(x - t)dt}}$

Post an R script as a block quote:

slopes = function(tsdat) {
star = min(time(tsdat))
slopes = rep(NA,12)
for (i in 1:12){
dat.win = window(tsdat,start=c(star,i),deltat=1)
yr = time(dat.win)
slopes[i] = ifelse(sum(!is.na(dat.win)) < 2, NA, coef(lm(dat.win~yr))[2])
}
slopes}

slope(Data$aws[,8]) all.slope = function(alldat) { nc = ncol(alldat) slop = matrix(NA, nrow = nc, ncol = 12) colnames(slop) = month.abb for (j in 1:nc) { slop[j,]= slope(alldat[,j])} slop} test3 = all.slope(Data$aws[,6])

Quotes copy out wrong. This needs fixing.

New test:

Attach text document as .doc file:

collation_functions

$SS = {1 \over 2}\sum\limits_{t = 1}^N {\sum\limits_{i,j = 1}^r {\mathop \delta \nolimits_i (t)\mathop \delta \nolimits_j (t)\left( {(x_i (t) - \mu _i ) - (x_j (t) - \mu _j )} \right)^2 } }$

$SS = \sum\limits_{t = 1}^N {\sum\limits_{k = 1}^r {\omega _k (t)\delta _k (t)\left( {x_k (t) - \tau (t) - \mu _k )} \right)^2 } }$

$SS = \sum\limits_{t = 1}^N {\sum\limits_{k = 1}^r {\omega _k (t)\delta _k (t)\left( {x_k (t) - \tau (t) - \mu _k (m(t))} \right)^2 } }$

$x_k (t) = \tau (t) + \mu _k + \epsilon _k (t), t = 1,...,N, k = 1,...,r$

Filed under Uncategorized

### 2 responses to “Test Post”

1. Nick Stokes

Roman,
I have written a R script to verify Giorgio’s calculation. It does – I get a symmetric distribution, mean 0.0175 deg C/decade. and standard deviation 0.189 C/dec. The histogram is here. I tried to post a comment on his blog, but it hasn’t shown yet.

To make it easier in R I edited (with emacs) to turn -9999 into NA and to separate the station numbers from the years.

Here’s the script:
#### A program written by Nick Stokes, 13 Dec 2009, to calculate the changes to regression

# A function to calculate regression slope. I hope it is faster than lm()
slope<-function(v,jj){
m=jj-mean(jj)
s=(v %*% m)/(m %*% m)
s
}

#####################
# I edited (emacs) to put a blank between the station number and year, and to change -9999 to NA (add .txt)

# Read in data from the files in matrix form
if(T){ #change to F after you have read in th efiles once
vmean <- matrix(scan("v2.mean.txt", 0, skip=0,na.strings = "NA"), ncol=14, byrow=TRUE)
# Now, to save time, move to annual averages
vmean_ann=vmean[,1:3]
vmean_ann[,3]=rowMeans(vmean[,3:14], na.rm = T)
}

# Initialise
vv=rep(0.,200) # regression y vector
jj=rep(0,200) # regression y vector

len=length(vmean_ann[,1])

j=1
k=0
kk=0
m=0
# counters. j is row of adjusted file. m is station counter
# k,kk are local row (year) counter (for station m). k skips NA's, kk doesn't

# loop over all rows in v2.mean
for(i in 1:(len-1)){
kk=kk+1
# to find matching rows, first check diff between stat nos and years
if(u[1]<0){
}
# If we have a match, add to regression vec vv[]
if(u[1]==0 & u[2]==0 ){

if(!is.na(u[3])){ # don't add to regression if NA
jj[k]=kk # x for regression
vv[k]=u[3] # discrepancies for regression
}
if(j0){
m=m+1 # m is station counter
k=0 # zero local counters
kk=0
}
}
# Now prepare histogram. Comment out jpeg and dev.off() to get screen graphics