Skip to main content

Modeling Trajectories and Time Series

  • Chapter
  • First Online:
Modern Psychometrics with R

Part of the book series: Use R! ((USE R))

Abstract

This chapter presents various modeling options for trajectories and time series. The first part covers hidden Markov models where the aim is to find latent states between which a participant can switch back and forth during an experimental task. Extended modeling options in terms of including covariates are presented as well. The second part introduces time series analysis. The main focus is on a parametric model class called ARIMA, representing a flexible regression framework for time series able to handle autocorrelated residuals. As a special ARIMA flavor, intervention analysis is presented which allows researchers to study whether a critical event had an impact on the series or not. The third part covers functional data analysis, applicable to data settings where each individual produces its own trajectory, subject to smoothing. In addition to functional regression modeling, a functional version of principal component analysis is presented.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    We omit any positive feelings here since this is simply not realistic.

  2. 2.

    See https://implicit.harvard.edu/; data are publicly available on https://osf.io/y9hiq/.

  3. 3.

    The SMA function in TTR (Ulrich, 2017) can be used for decomposition nonseasonal data.

  4. 4.

    Instead of decompose the stl function can be used which provides additional decomposition options.

  5. 5.

    For simplicity in notation, let us ignore for the moment that we differenced the time series and write y t instead of yt′.

  6. 6.

    Note that the first value in the correlogram is the lag-0 correlation which is of course 1 and can be ignored.

  7. 7.

    Note the similarity of this equation to the classical true score model in the first chapter.

  8. 8.

    A simplified version of this plot can be produced via summary( fpca) .

References

  • Bornstein, A. M., & Daw, N. D. (2012). Dissociating hippocampal and striatal contributions to sequential prediction learning. European Journal of Neuroscience, 35, 1011–1023.

    Article  Google Scholar 

  • Box, G. E. P., & Tiao, G. (1975). Intervention analysis with applications to economic and environmental problems. Journal of the American Statistical Association, 70, 70–79.

    Article  MathSciNet  Google Scholar 

  • Burns, D. M., Houpt, J. W., Townsend, J. T., & Endres, M. J. (2013). Functional principal components analysis of workload capacity functions. Behavior Research Methods, 45(4), 1–18.

    Article  Google Scholar 

  • Cowpertwait, P. S. P., & Metcalfe, A. V. (2009). Introductory time series with R. New York: Springer.

    MATH  Google Scholar 

  • Cryer, J. D., & Chan, K. S. (2008). Time series analysis with applications in R (2nd ed.). New York: Springer.

    MATH  Google Scholar 

  • Cuesta-Albertos, J. A., & Febrero-Bande, M. (2010). A simple multiway anova for functional data. Test, 19, 537–557.

    Article  MathSciNet  Google Scholar 

  • Epskamp, S., Cramer, A. O. J., Waldorp, L. J., Schmittmann, V. D., & Borsboom, D. (2012). qgraph: Network visualizations of relationships in psychometric data. Journal of Statistical Software, 48(4), 1–18. http://www.jstatsoft.org/v48/i04/

    Article  Google Scholar 

  • Febrero-Bande, M., & de la Fuente, M. (2012). Statistical computing in functional data analysis: The R package fda.usc. Journal of Statistical Software, 51(4), 1–28. https://www.jstatsoft.org/v051/i04

    Article  Google Scholar 

  • Goldsmith, J., Scheipl, F., Huang, L., Wrobel, J., Gellar, J., Harezlak, J., McLean, M. W., Swihart, B., Xiao, L., Crainiceanu, C., & Reiss, P. T. (2016). refund: Regression with functional data. R package version 0.1-16. https://CRAN.R-project.org/package=refund

  • Greenwald, A. G., & Banaji, M. R. (1995). Implicit social cognition: Attitudes, self-esteem, and stereotypes. Psychological Review, 102, 4–27.

    Article  Google Scholar 

  • Greenwald, A. G., McGhee, D. E., & Schwartz, J. K. L. (1998). Measuring individual differences in implicit cognition: The implicit association test. Journal of Personality and Social Psychology, 74, 1464–1480.

    Article  Google Scholar 

  • Greenwald, A. G., Nosek, B. A., & Banaji, M. R. (2003). Understanding and using the implicit association test: I. An improved scoring algorithm. Journal of Personality and Social Psychology, 85, 197–216.

    Article  Google Scholar 

  • Greven, S., & Scheipl, F. (2017). A general framework for functional regression modelling. Statistical Modelling, 17, 1–35.

    Article  MathSciNet  Google Scholar 

  • Griffiths, T. L., Steyvers, M., & Firl, A. (2007). Google and the mind: Predicting fluency with PageRank. Psychological Science, 18, 1069–1076.

    Article  Google Scholar 

  • Hyndman, R. J., & Athanasopoulos, G. (2014). Forecasting: Principles and practice. Melbourne: OTexts. http://www.otexts.org

    Google Scholar 

  • Hyndman, R. J., & Khandakar, Y. (2008). Automatic time series forecasting: The forecast package for R. Journal of Statistical Software, 26(3), 1–22. http://www.jstatsoft.org/article/view/v027i03

    Google Scholar 

  • Jebb, A. T., Tay, L., Wang, W., & Huang, Q. (2015). Time series analysis for psychological research: Examining and forecasting change. Frontiers in Psychology, 6(727), 1–24. http://journal.frontiersin.org/article/10.3389/fpsyg.2015.00727

    Google Scholar 

  • Kokoszka, P., & Reimherr, M. (2017). Introduction to functional data analysis. Boca Raton: CRC Press.

    MATH  Google Scholar 

  • Levitin, D. J., Nuzzo, R. L., Wines, B. W., & Ramsay, J. O. (2007). Introduction to functional data analysis. Canadian Psychology, 48, 135–155.

    Article  Google Scholar 

  • Long, J. D. (2011). Longitudinal data analysis for the behavioral sciences using R. Thousand Oaks: SAGE Publishing.

    Google Scholar 

  • McLean, M. W., Hooker, G., Staicu, A. M., Scheipl, F., & Ruppert, D. (2014). Functional generalized additive models. Journal of Computational and Graphical Statistics, 23, 249–269.

    Article  MathSciNet  Google Scholar 

  • Mirman, D. (2014). Growth curve analysis and visualization using R. Boca Raton: Chapman & Hall/CRC.

    Google Scholar 

  • Nosek, B. A., Banaji, M. R., & Greenwald, A. G. (2002). Harvesting implicit group attitudes and beliefs from a demonstration web site. Group Dynamics: Theory, Research, and Practice, 6, 101–115.

    Article  Google Scholar 

  • Petris, G., & Petrone, S. (2011). State space models in R. Journal of Statistical Software, 41(4), 1–25. https://www.jstatsoft.org/v041/i04

    Article  Google Scholar 

  • Pfaff, B. (2008). VAR, SVAR and SVEC models: Implementation within R package vars. Journal of Statistical Software, 27(4), 1–32. https://www.jstatsoft.org/article/view/v027i04

    Article  Google Scholar 

  • Ramsay, J. O., & Silverman, B. W. (2002). Applied functional data analysis: Methods and case studies. New York: Springer.

    Book  Google Scholar 

  • Ramsay, J. O., & Silverman, B. W. (2005). Functional data analysis (2nd ed.). New York: Springer.

    MATH  Google Scholar 

  • Ramsay, J. O., Hooker, G., & Graves, S. (2009). Functional data analysis with R and MATLAB. New York: Springer.

    Book  Google Scholar 

  • Scheipl, F., Staicu, A. M., & Greven, S. (2015). Functional additive mixed models. Journal of Computational and Graphical Statistics, 24, 477–501.

    Article  MathSciNet  Google Scholar 

  • Spedicato, G. A. (2017). markovchain: Easy handling of discrete time Markov chains. R package version 0.6.8.1.

    Google Scholar 

  • Trapletti, A., & Hornik, K. (2017). tseries: Time series analysis and computational finance. R package version 0.10–42. https://CRAN.R-project.org/package=tseries

  • Ulrich, J. (2017). TTR: Technical trading rules. R package version 0.23–2. https://CRAN.R-project.org/package=TTR

  • Vines, B. W., Krumhansl, C. L., Wanderley, M. M., & Levitin, D. J. (2006). Cross-modal interactions in the perception of musical performance. Cognition, 101, 80–113.

    Article  Google Scholar 

  • Visser, I. (2011). Seven things to remember about hidden Markov models: A tutorial on Markovian models for time series. Journal of Mathematical Psychology, 55, 403–415.

    Article  MathSciNet  Google Scholar 

  • Visser, I., & Speekenbrink, M. (2010). depmixS4: An R package for hidden Markov models. Journal of Statistical Software, 36(7), 1–21. http://www.jstatsoft.org/v36/i07/

    Article  Google Scholar 

  • Wickens, T. D. (1982). Models for behavior: Stochastic processes in psychology. San Francisco: W.H. Freeman and Co.

    MATH  Google Scholar 

  • Zeileis, A., & Hothorn, T. (2002). Diagnostic checking in regression relationships. R News, 2(3), 7–10. https://CRAN.R-project.org/doc/Rnews/

    Google Scholar 

  • Zeileis, A., Leisch, F., Hornik, K., & Kleiber, C. (2002). strucchange: An R package for testing for structural change in linear regression models. Journal of Statistical Software, 7(2), 1–38. http://www.jstatsoft.org/v07/i02/

    Article  Google Scholar 

  • Zhang, J. T. (2014). Analysis of variance for functional data. Boca Raton: CRC Press.

    MATH  Google Scholar 

  • Zucchini, W., MacDonald, I. L., & Langrock, R. (2016). Hidden Markov models for time series: An introduction using R (2nd ed.). Boca Raton: Chapman & Hall/CRC.

    Book  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Mair, P. (2018). Modeling Trajectories and Time Series. In: Modern Psychometrics with R. Use R!. Springer, Cham. https://doi.org/10.1007/978-3-319-93177-7_13

Download citation

Publish with us

Policies and ethics