It fits a generalised additive model (GAM) to transformed polar tongue data
and it returns a model in polar coordinates. Use plot_polar_smooths()
for plotting.
Usage
polar_gam(
formula,
data,
origin = NULL,
fan_lines = c(10, 25),
AR_start = NULL,
...
)
Arguments
- formula
A GAM formula.
- data
A data set containing the spline coordinates (cartesian coordinates must be in columns named
X
andY
, polar coordinates in columns namedangle
andradius
; these are the defaults in data imported withread_aaa()
).- origin
The coordinates of the origin as a vector of
c(x, y)
coordinates.- fan_lines
A numeric vector with two fan lines (the default is
c(10, 25)
).- AR_start
The
AR.start
argument to be passed tomgcv::bam()
.- ...
Arguments to be passed to
mgcv::bam()
.
Value
An object of class "gam"
as described in
gamObject
.
Details
It is advised to fit a separate model per speaker, unless you have a working method for inter-speaker normalisation of the coordinates.
Examples
# \donttest{
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
tongue_it01 <- filter(tongue, speaker == "it01")
pgam <- polar_gam(Y ~ s(X, by = c2_place) + s(X, word, bs = "fs"),
data = tongue_it01)
#> The origin is x = 14.3901267816422, y = -65.2315420525846.
# }