Modelling longitudinal data where the effect of time varies in functional form between individuals Context:
Imagine you had a longitudinal study which measured a dependent variable (DV) once a week for 20 weeks on 200 participants. Although I'm interested in general, typical DVs that I'm thinking of include job performance following hire or various well-being measures following a clinical psychology intervention.
I know that multilevel modelling can be used to model the relationship between time and the DV. You can also allow coefficients (e.g., intercepts, slopes, etc.) to vary between individuals and estimate the particular values for participants. But what if when visually inspecting the data you find that the relationship between time and the DV is any one of the following:


*

*different in functional form (perhaps some are linear and others are exponential or some have a discontinuity)

*different in error variance (some individuals are more volatile from one time point to the next)


Questions:


*

*What would be a good way to approach modelling data like this? 

*Specifically, what approaches are good at identifying different types of relationships, and categorising individuals with regards to their type?

*What implementations exist in R for such analyses?

*Are there any references on how to do this: textbook or actual application?

 A: I'd recommend taking a look at a couple of papers by Heping Zhang using adaptive splines for modeling longitudinal data:


*

*Multivariate adaptive splines for analysis of longitudinal data (Free PDF)

*Mixed effects multivariate adaptive splines model for the analysis of longitudinal and growth curve data
In addition, see the MASAL page for software including an R package.
A: It looks to me like Growth Mixture Models might have potential to allow you to examine your error variance. (PDF here). (I'm not sure what multiplicative heteroscedastic models are, but I will definitely have to check them out).
Latent group based trajectory models have become really popular lately in criminology. But many people simply take for granted that groups actually exist, and some astute research has pointed out that you will find groups even in random data. Also to note Nagin's group based modelling approach does not allow you to assess your error (and honestly I have never seen a model that would look anything like a discontinuity).
Although it would be difficult with 20 time points, for exploratory purposes creating simple heuristics to identify patterns could be helpful (e.g. always low or always high, coefficient of variation). I'm envisioning sparklines in a spreadsheet or parallel coordinates plots but I doubt they would be helpful (I honestly have not ever seen a parallel coordinate plot that is very enlightening).
Good luck
A: Four years after asking this question, I've learnt a few things, so perhaps I should add a few ideas.
I think Bayesian hierarchical modelling provides a flexible approach to this problem. 
Software:
Tools like jags, stan, WinBugs, and so on potentially combined with their respective R interface packages (e.g., rjags, rstan) make it easier to specify such models.
Varying within person error:
Bayesian models make it easy to specify the within person error variance as a random factor that varies between people.
For example, you could model scores $y$ on participants $i=1,..., n$ at time points $j=1,...J$ as
$$y_{ij}\sim N(\mu_i, \sigma^2_i)$$
$$\mu_i = \gamma$$
$$\gamma \sim N(\mu_\gamma, \sigma^2_\gamma)$$
$$\sigma_i \sim \rm{Gamma}(\alpha, \beta)$$
Thus the standard deviation of each person might be modelled as a gamma distribution. I have found this to be an important parameter in many psychological domains where people vary in how much they vary over time.
Latent classes of curves:
I have not explored this idea as much yet, but it is relatively straight forward to specify two or more possible data generating functions for each individual and then let the Bayesian model choose the most likely model for a given individual. Thus, you would typically get posterior probabilities for each individual regarding which functional form describes the individuals data. 
As a sketch of an idea for a model, you could have something like the following:
$$y_{ij} \sim N(\mu_{ij}, \sigma^2)$$
$$\mu_{ij} = \gamma_i \lambda_{ij}^{(1)} + (1 - \gamma_i)  \lambda_{ij}^{(2)}$$
$$\lambda_{ij}^{(1)} = \theta^{(1)}_{1i} + \theta^{(1)}_{2i} \exp(-\theta^{(1)}_{3i}) $$
$$\lambda_{ij}^{(2)} =\theta^{(2)}_{1i} + \theta^{(2)}_{2i} x_{ij} + \theta^{(2)}_{3i} x^2_{ij}$$
$$\gamma_i = \rm{Bernoulli}(\pi_i)$$
Where $x_{ij}$ is time and $\lambda_{ij}^{(1)}$ represents expected values for a three parameter exponential model and $\lambda_{ij}^{(2)}$ represents expected values for a quadratic model. $\pi_i$ represents the probability that model will choose $\lambda_{ij}^{(1)}$.
A: John Fox has a great appendix available on-line using nlme to look at longitudinal data. It may be useful for you:
http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf
There's a lot of great stuff there (and Fox' books are generally quite good!).
A: I would suggest to look at the following three directions:


*

*longitudinal clustering: this is unsupervised, but you use k-means approach relying on the Calinsky criterion for assessing quality of the partitioning (package kml, and references included in the online help); so basically, it won't help identifying specific shape for individual time course, but just separate homogeneous evolution profile

*some kind of latent growth curve accounting for heteroscedasticity: my best guess would be to look at the extensive references around MPlus software, especially the FAQ and mailing. I've also heard of random effect multiplicative heteroscedastic model (try googling around those keywords). I find these papers (1, 2) interesting, but I didn't look at them in details. I will update with references on neuropsychological assessment once back to my office.

*functional PCA (fpca package) but it may be worth looking at functional data analysis
Other references (just browsed on the fly):


*

*Willett & Bull (2004), Latent Growth Curve Analysis -- the authors use LGC on non-linear reading trajectories

*Welch (2007), Model Fit and Interpretation of Non-Linear Latent Growth Curve Models -- a PhD on modeling non-linear change in the context of latent growth modeling

*Berkey CS, Laird NM (1986). Nonlinear growth curve analysis: estimating the population parameters. Ann Hum Biol. 1986 Mar-Apr;13(2):111-28

*Rice (2003), Functional and Longitudinal Data Analysis: Perspectives on Smoothing

*Wu, Fan and Müller (2007). Varying-Coefficient Functional Linear Regression
