% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simu_barma.R
\name{simu_barma}
\alias{simu_barma}
\title{Simulate a Beta Autoregressive Moving Average (BARMA) Time Series}
\usage{
simu_barma(
  n,
  alpha = 0,
  varphi = NA,
  theta = NA,
  phi = 20,
  freq = 12,
  link = "logit"
)
}
\arguments{
\item{n}{The desired length of the final time series (after burn-in).}

\item{alpha}{The intercept term (\eqn{\alpha}) in the linear predictor.
Default is `0.0`.}

\item{varphi}{A numeric vector of autoregressive (AR) parameters (\eqn{\varphi}).
Default is `NA` for models without an AR component.}

\item{theta}{A numeric vector of moving average (MA) parameters (\eqn{\theta}).
Default is `NA` for models without an MA component.}

\item{phi}{The precision parameter (\eqn{\phi > 0}) of the Beta distribution.
Higher values result in less variance. Default is `20`.}

\item{freq}{The frequency of the resulting `ts` object (e.g., 12 for monthly,
4 for quarterly). Default is `12`.}

\item{link}{The link function to connect the mean \eqn{\mu_t} to the linear
predictor. Must be one of `"logit"` (default), `"probit"`, `"cloglog"`, or
`"loglog"`.}
}
\value{
A `ts` object of length `n` containing the simulated Beta-distributed
  time series.
}
\description{
Generates a random time series from a Beta Autoregressive Moving Average
(BARMA) model. The function can simulate BARMA(p,q), BAR(p), or BMA(q)
processes.
}
\details{
The model type is determined by the `varphi` and `theta` parameters:
\itemize{
  \item **BARMA(p,q):** Both `varphi` and `theta` are provided.
  \item **BAR(p):** Only `varphi` is provided (`theta` is `NA`).
  \item **BMA(q):** Only `theta` is provided (`varphi` is `NA`).
}
}
\examples{
# Set seed for reproducibility
# --- Example 1: Simulate a BAR(1) process ---
# y_t depends on y_{t-1}
set.seed(2025)
bar1_series <- simu_barma(n = 250, alpha = 0.0, varphi = 0.5, phi = 20,
link = "logit")
plot(bar1_series, main = "Simulated BAR(1) Process", ylab = "Value")

# --- Example 2: Simulate a BMA(1) process ---
# y_t depends on the previous error term
set.seed(2025)
bma1_series <- simu_barma(n = 250, alpha = 0.0, theta = -0.2, phi = 20)
plot(bma1_series, main = "Simulated BMA(1) Process", ylab = "Value")

# --- Example 3: Simulate a BARMA(2,1) process with a cloglog link ---
set.seed(2025)
barma21_series <- simu_barma(
  n = 200,
  alpha = 0.0,
  varphi = c(0.4, 0.2), # AR(2) components
  theta = -0.3,         # MA(1) component
  phi = 20,
  link = "cloglog"
)
plot(barma21_series, main = "Simulated BARMA(2,1) Process", ylab = "Value")

}
\seealso{
\code{\link{barma}}, \code{\link{make_link_structure}}
}
\author{
Original R code by: Fabio M. Bayer (Federal University of Santa Maria, <bayer@ufsm.br>)
Modified and improved by: Everton da Costa (Federal University of Pernambuco, <everto.cost@gmail.com>)
}
