mkAR: Generate a Data Frame With Variables Suitable For an AR Like...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/variableTransformation.R

Description

The variables added to the data frame corresponding to the first argument of the function are the former inter spike intervals. These variables are moreover transformed with mkM2U so that they have an approximately uniform distribution on their definition domain.

Usage

1
mkAR(df, low, high, max.order, selfName = "lN.1",...)

Arguments

df

a data frame. This data frame should contain a variable time like data frames returned by mkGLMdf.

low

a numeric, the smallest value of variable time from which the transformation is looked for. If missing defaults to the smallest time.

high

a numeric, the largest value of variable time up to which the transformation is looked for. If missing defaults to the largest time.

max.order

a postive integer, the maximal order of the AR model. How many previous inter spike intervals should be used in order to predict the duration of the next interval?

selfName

a character string or an integer specifying the variable of df containing the elapsed time since the last spike of the considered neuron.

...

additional arguments passed to mkM2U

.

Details

When max.order > 1 the previous inter spike intervals are all transformed using the "map to uniform" function estimated from the inter spike intervals at lag 1.

Value

A data frame is returned. In addition to the variables of df the returned data frame contains a variable est with the transformed elapsed time since the last spike of the neuron and i1t, i2t,...,i max.order t, the transformed previous inter spike intervals. The returned data frame has also four attributes:

fmla

a formula suitable for a first argument of, say, gssanova.

m2uL

the function returned by mkM2U transforming the elasped time since the last spike of the neuron.

m2uI

the function returned by mkM2U transforming the first former inter spike interval.

call

the matched call.

Author(s)

Christophe Pouzat [email protected]

See Also

mkM2U, gssanova

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
require(STAR)
data(e060824spont)
DFA <- subset(mkGLMdf(e060824spont,0.004,0,59),neuron==1)
DFA <- mkAR(DFA, 0, 29, 5, maxiter=200)
head(DFA)
tail(DFA)
ar.fit <- gssanova(attr(DFA,"fmla"), data=DFA,family="binomial",seed=20061001)
plot(ar.fit %qp% "est")
plot(ar.fit %qp% "i1t")
plot(ar.fit %qp% "i2t")
plot(ar.fit %qp% "i3t")
plot(ar.fit %qp% "i4t")
plot(ar.fit %qp% "i5t")

## End(Not run)

STAR documentation built on May 30, 2017, 3:06 a.m.