# Convert the GPS observations and DR path into a data list

### Description

The data list prepared by this function will be the input to the `BMAnimalTrack`

function.

### Usage

1 2 | ```
as.dataList(X, Y, Ytime, Xtime=NULL, s2G, timeUnit=1, dUnit=1,
dMx=NULL, betaOrder=1, scale=TRUE)
``` |

### Arguments

`X` |
DR path. The length of it is |

`Y` |
GPS observations. |

`Ytime` |
The time points where the GPS observations are obtained. It has to be a subset of |

`Xtime` |
The time points where the DR path is obtained. When unspecified taken to be 1:T. See details for more. |

`s2G` |
The variance of the measurement errors in the GPS observations. |

`timeUnit` |
Optional. If provided, the working time points become 1:T/timeUnit, which can be used to stablize the estimates of s2H. |

`dUnit` |
Optional. Distance unit. It can be used to scale |

`dMx` |
The design matrix of the parametric bias |

`betaOrder` |
Only used when |

`scale` |
Logical. Whether to scale the design matrix |

### Details

If `dMx`

is not specified. The *h(t)* is chosen to be polynomial of order `betaOrder`

.

For `Xtime`

and `Ytime`

, they can either be vectors of POSIXlt/POSIXt time points from `strptime`

or character or numeric vectors. But they must be POSIXlt/POSIXt time points when the `Xtime`

are not regularly spaced. See the example in `Trip1`

.

### Value

A list of the following values

`XMx` |
A matrix with |

`glist` |
A list with of the data on the GPS time points |

.

### Author(s)

Yang (Seagle) Liu <yang.liu@stat.ubc.ca>

### References

Liu, Y., Battaile, B. C., Zidek, J. V., and Trites, A. (2014). Bayesian melding of the Dead-Reckoned path and gps measurements for an accurate and high-resolution path of marine mammals. arXiv preprint arXiv: 1411.6683.

### Examples

1 2 3 4 5 6 7 8 | ```
set.seed(1)
#Generating data from our
dlist <- dataSim(T=100, K=10, s2H=1, s2D=0.1, betaVec=c(1))
gpsObs <- dlist$Y
gpsTime <- dlist$Ytime
drPath <- dlist$X
wlist <- as.dataList(drPath, gpsObs, gpsTime, timeUnit=1, s2G=0.01, dUnit=1, betaOrder=1)
#Example continuous in "BMAnimalTrack".
``` |