indivClo: Estimates either an uncoupled or coupled oscillator model for...

View source: R/clo.R

indivCloR Documentation

Estimates either an uncoupled or coupled oscillator model for each dyad.

Description

Both models predict the second derivatives of the observed state variables (with linear trends removed). For the uncoupled oscillator, the predictors are each person's own observed state variables (again with linear trends removed), as well as each person's own first derivatives of the observed state variables (again with linear trends removed. For the coupled oscillator, the predictors are each person's own and partner's observed state variables (again with linear trends removed), as well as each person's own and partner's first derivatives of the observed state variables (again with linear trends removed).

Usage

indivClo(derivData, whichModel)

Arguments

derivData

A dataframe that was produced with the "estDerivs" function.

whichModel

Whether the model to be estimated is the "uncoupled" or "coupled" oscillator.

Value

The function returns a list including: 1) the adjusted R^2 for the model for each dyad (called "R2"), and 2) the parameter estimates for the model for each dyad (called "params", for use in either predicting, or being predicted by, the system variable).

Examples

data <- rties_ExampleDataShort
newData <- dataPrep(basedata=data, dyadId="couple", personId="person", 
obs_name="dial", dist_name="female", time_name="time")
taus <-c(2,3)
embeds <- c(3,4)
delta <- 1
derivs <- estDerivs(prepData=newData, taus=taus, embeds=embeds, delta=delta, idConvention=500)
clo <- indivClo(derivData=derivs$data, whichModel="coupled")
summary(clo$R2)
head(clo$params)

ebmtnprof/rties documentation built on Aug. 25, 2022, 7:47 p.m.