Learn R Programming

Pomic (version 0.9.1)

pomic.timeseries: Pomic calculation for numerical patterns supposing an autocorrelation (e.g. time series)

Description

This function calculate a serie of POMIC values of simulations results compared to a time serie taken as field pattern. The POMIC values are computed for group of observations within a running window, eventually for differences among following values and for the whole data.

Usage

pomic.timeseries(object1, object2, eps=10^-30, nrange=1000,
		fullmsd=FALSE,  plotting=FALSE, timevector=NULL, 
    half_window_size=5,check_whole=TRUE,check_diffs=FALSE,...)

Arguments

object1
Numerical, vector of the field pattern
object2
Numerical, matrix of simulations results (columns are replicates)
eps
Numerical, value to use when the likelihood = 0 for mathematical stability
nrange
Numerical, number of interval to consider for the probability density function creation and integration
fullmsd
Boolean, should the full cross MSD be calculated as well (here taken as relative to field serie mean value)
plotting
Boolean, should a plot illustrating the calculation be created
timevector
Numerical, time of the serie (for plotting purpose only, no handling so far of differences of dt)
half_window_size
Numerical, number of points to take around each point of the time serie to create an independent "pattern" checked with the pomic.corrected function
check_whole
Boolean, should the pomic.corrected value be also computed for the entire dataset (disregarding autocorrelation)
check_diffs
Boolean, should the pomic.corrected value be also computed for the differences of values between t and t+1
...
eventual information to give to the last plot (if plotting=T) ...

Value

  • Return a list containing:
  • field_datathe field data
  • sim_datathe simulation data
  • simpleresulta table of 3 rows with:
  • - SumPOMICsthe sum of POMIC scores
  • - Sum_nb_pointssum of nb of points analyzed in each window
  • - MSD_relativea relative MSD of the entire series
  • resulta table of 2 rows and several columns (corresponding to the time the data were subset) with:
  • - POMICPOMIC values per subset dataset
  • - nb_pointsnumber of points analyzed with the pomic.simple function in the corresponding subset

Details

The KL divergence is not calculated. This function was thought of to look at temporal patterns, but could also be applied to spatially autocorrelated variables (e.g. Ripley's K-function). If object1 and object2 are given as time series (class), the function works normally only if they have equal times. The plotting will use then the time defined in those time series objects.

See Also

pomic.simple pomic

Examples

Run this code
timeserie<-runif(100)+1:100-(seq(1,10,length=100)^2)
model<-NULL
for(i in 1:100){  
  model<-cbind(model,runif(100)+1:100-(seq(1,10,length=100)^2.01)) 
}
pomic.timeseries(timeserie,model,eps=10^-20,fullmsd=TRUE,
                  plotting=TRUE,half_window_size=10,
                  check_whole=TRUE,check_diffs=TRUE)

Run the code above in your browser using DataLab