<jupyter_start><jupyter_text>| [Table of Contents](table_of_contents) | [Data and model](data_and_model) | [Modeling](modeling) | [Residual diagnostics](residual_diagnostics) | [Fitting summary](fitting_summary) | [Session info](session_info) | [References](references) | [Appendix - Tools, R functions](appendix) | **Authors:** <NAME>, <NAME>, <NAME>   *[Faculty of Science](https://www.upjs.sk/en/faculty-of-science/?prefferedLang=EN), P. J. Šafárik University in Košice, Slovakia*  emails: [<EMAIL>](mailto:<EMAIL>), [<EMAIL>](mailto:<EMAIL>)***** FDSLRM applications - Tourism **   Quarterly visitor nights for a region of Australia    Table of Contents * [Data and model](data_and_model) - data and model description, estimating parameters, software* [Modeling](modeling) - loading R functions and packages, data plot, periodogram* [Residual diagnostics](residual_diagnostics) - description of graphical tools, numerical tests* [Fitting summary](fitting_summary) - estimated model parameters, fit summary* [Session info](session_info) - list of applied R packages in computations* [References](references) - list of detailed references for data and applied methods* [Appendix - Tools, R functions](appendix) - brief help on applied diagnostic tools, R functions**To get back to the contents, use the Home key.** *** Data and model  Data descriptionIn this FDSLRM application we model the econometric time series data set, called `visnights`, representing *total quarterly visitor nights* (in millions) from 1998-2016 in one of the regions of Australia - inner zone of Victoria state. The number of time series observations is $n=76$, the correspoding plot with more details is shown in the following section **_Modeling_**. The data was adapted from *Hyndman, 2018*. Model descriptionThe tourism data can be succesfully fitted by the FDSLRM of the form:$$ X(t)=\beta_1+\beta_2\cos\left(\tfrac{2\pi t}{76}\right)+\beta_3\sin\left(\tfrac{2\pi t\cdot 2}{76}\right)+Y_1\cos\left(\tfrac{2\pi t\cdot 19 }{76}\right)+Y_2\sin\left(\tfrac{2\pi t\cdot 17}{76}\right)+Y_3\cos\left(\tfrac{2\pi t\cdot 38}{76}\right)+w(t), \, t\in \mathbb{N},$$ where- $\boldsymbol{\beta}=(\beta_1,\,\beta_2,\,\beta_3)' \in \mathbb{R}^3\,$ is a vector of real regression coefficients, - $\mathbf{Y} = (Y_1, Y_2, Y_3)' \sim \mathcal{N}_3(\boldsymbol{0}, \mathrm{D})\,$ is an unobservable Gaussian random vector with zero mean vector and covariance matrix $\mathrm{D} = \,\scriptstyle \begin{pmatrix} \sigma_1^2 & 0 & 0 \\ 0 & \sigma_2^2 & 0 \\ 0 & 0 &\sigma_3^2\end{pmatrix}$, - $w(t) \sim \mathcal{iid}\, \mathcal{N} (0, \sigma_0^2)\,$ is Gaussian iid noise with variance $\sigma_0^2$,- $\boldsymbol{\nu}= (\sigma_0^2, \sigma_1^2, \sigma_2^2, \sigma_3^2) \in \mathbb{R}_{+}^4 \,$ is a vector of real nonnegative variance-covariance parameters.We identified the given and most parsimonious structure of the FDSLRM using an iterative process of the model building and selection based on exploratory tools of *spectral analysis* (*Gajdoš et al., 2017*; *Brockwell & Davis, 2006*) and *residual diagnostics* (see sections **_Modelling_** and **_Residual diagnostics_**). Estimating the model parametersDuring the modelling, we obtained: - estimates $\boldsymbol{\nu^*}=(0.108, 0.001, 0.227, 0.021)'$ of variance-covariance components $\boldsymbol{\nu} $ by *residual maximum likelihood (REML)*, - estimates  $\boldsymbol{\beta^*}=(4.254, 0.256, -0.247)'$ of regression parameters in trend $\boldsymbol{\beta} $ by *weighted least squares*, - predictions $\mathbf{Y^*}=(-0.017, 0.474, -0.140)'$ of the random vector $\mathbf{Y}$ using *the best linear unbiased predictor (BLUP)* procedure. The methods and procedures described for FDSLRM in more detail can be found in *Štulajter 2002, 2003; Gajdoš et al., 2018*, **see especially** [Hančová et al., 2019](https://github.com/fdslrm/EBLUP-NE). This FDSLRM application also belongs to real data set illustrative examples in our current paper [Hančová et al., 2019](https://github.com/fdslrm/EBLUP-NE) about estimating FDSLRM variance parameters. Estimated values of $\boldsymbol{\beta}, \boldsymbol{\nu}$ and predictions of $\mathbf{Y}$ are also presented in the form of tables in **_Fitting summary_**.  Computational softwareAs for numerical calculations, we conducted our computations in _the R statistical computing language_ (https://www.r-project.org; _R Development Core Team, 2018_) with the key libraries _nlme_ (*Pinhero et al., 2018,  Galecki & Burzykowski, 2013*), _fpp2_ (*Hyndman, 2018*), R functions for LMM programmed by Singer (*Singer at al., 2017*) and  R functions for FDSLRM programmed by authors of the Jupyter notebook included in _fdslrm_ package. The complete list of used R libraries is included in **_Session info_**. | [Table of Contents](table_of_contents) | [Data and model](data_and_model) | [Modeling](modeling) | [Residual diagnostics](residual_diagnostics) | [Fitting summary](fitting_summary) | [Session info](session_info) | [References](references) | [Appendix - Tools, R functions](appendix) | *** Modeling  > **Remark.** *Mean value (or FDSLRM trend) component* $m(t)$ of our FDSLRM  is the real function in the form of: - *the linear regression (LR)* $-$ the linear combination of deterministic real functions $ f_1(t)=1,\,f_2(t)=\cos\left(\tfrac{2\pi t}{76}\right),\,f_3(t)=\sin\left(\tfrac{2\pi t\cdot 2 }{76}\right)$ with real amplitudes $\beta_1, \beta_2, \beta_3$$$ m(t) = \sum\limits_{i=1}^{3}f_i(t)\beta_i,  \, t \in \mathbb{N}. $$>>*Random errors (or FDSLRM errors) component* $\varepsilon(t)$ of our FDSLRM is the zero mean value time series consisting of:  - *finite discrete spectrum errors (FDS errors)*  $-$ the linear combination of deterministic real functions $v_1(t)=\cos\left(\tfrac{2\pi t\cdot 19}{76}\right),\,v_2(t)=\sin\left(\tfrac{2\pi t\cdot 19 }{76}\right),\,v_3(t)=\cos\left(\tfrac{2\pi t\cdot 38}{76}\right)$ with mutually uncorrelated random amplitudes  $Y_1,Y_2,Y_3$ and- *white noise errors (WN errors)* $-$ $\mathcal{wn}$ (or $\mathcal{iid}$) noise $w(t)$$$ \varepsilon(t) = \sum\limits_{j=1}^{3}v_j(t)Y_j + w(t),  \, t \in \mathbb{N}. $$  Loading R functions and packagesA brief help on all applied R functions and packages designed to work with FDSLRM is in the section **_Appendix_**.<jupyter_code># use this cell, if you started this notebook locally in your PC
library(fdslrm)
initialFDSLRM()
# use this cell, if you started this notebook in the Binder
devtools::source_url("https://github.com/fdslrm/fdslrmAllinOne/blob/master/fdslrmAllinOne.R?raw=TRUE")
initialFDSLRM()<jupyter_output>SHA-1 hash of file is f56b9d53e72a8575947a467930a2bdddb5b500ad<jupyter_text>Data plotThe tourism data was loaded from Hyndman's R package `fpp2` (*Hyndman, 2018*). The more detailed data description can be found in *Hyndman, 2018, sec. 10.1, p. 300*.<jupyter_code># IPython setting for output
options(repr.plot.res=120, repr.plot.height=4.5, repr.plot.width=6.5)

# Loading and plotting data from Hyndman's package fpp2
autoplot(window(visnights)[,15], ylab = "Visnights") # VICInner<jupyter_output><empty_output><jupyter_text>Spectral analysis - Periodogram Our econometric data shows some periodic patterns as they are influenced by seasons or regularly repeating events. To identify significant (Fourier) frequencies, we apply a spectral time series exploratory tool called *periodogram* (more details in *Gajdoš et al., 2017*).<jupyter_code># time series observations, times values, periodogram
dt <- as.numeric((window(visnights)[,15]))
t <- 1:length(dt)
periodo <- spec.pgram(dt, log="no")<jupyter_output><empty_output><jupyter_text>Six most significant frequencies according to values of spectrum in periodogram.<jupyter_code>drawTable(type = "periodogram", periodogram = periodo)<jupyter_output><empty_output><jupyter_text>> The raw frequencies from periodogram can be easily rewritten to the corresponding Fourier frequencies in the standard form $2\pi k/n$, where $k$ is the frequency order and $n$ is the number of time series observations (or a very close integer number); e.g. the first raw frequency $0.25$ can be expressed as $0.25=19/76$, which corresponds to the Fourier frequency $2\pi \cdot 19/76$.<jupyter_code># orders k for Fourier frequencies
print(round(76*c(0.250000,0.500000,0.025000,0.012500,0.0625000,0.2625000)))
fnames= c("19/76", "$38/76$", "$2/76$", "$1/76$", "$5/76$", "$20/76$")
drawTable(type = "periodogram", periodogram = periodo, frequencies = fnames)<jupyter_output><empty_output><jupyter_text>| [Table of Contents](table_of_contents) | [Data and model](data_and_model) | [Modeling](modeling) | [Residual diagnostics](residual_diagnostics) | [Fitting summary](fitting_summary) | [Session info](session_info) | [References](references) | [Appendix - Tools, R functions](appendix) | ***  Residual diagnostics  Our FDSLRM for the tourism data can be rewritten in the matrix form as a linear mixed model (LMM): $$\mathbf{X}=\mathrm{F}\boldsymbol{\beta}+\mathrm{V}\mathbf{Y}+\boldsymbol{w},$$where - $\mathbf{X} = (X(1), X(2), \ldots, X(76))'$ is a vector of the time series observations,- $\boldsymbol{w} = (w(1),w(2), \ldots, w(76))'$ is a random vector of corresponding iid (or white) noise values- model design matrices $\mathrm{F}, \mathrm{V}$ for our final model have the following structure: $$\mathrm{F} \,{\scriptsize = \, \begin{pmatrix}  1      & \cos\left(\tfrac{2\pi}{76}\right)   & \sin\left(\tfrac{2\pi\cdot 2}{76}\right) \\  1      & \cos\left(\tfrac{2\pi\cdot 2}{76}\right)  & \sin\left(\tfrac{2\pi\cdot 4}{76}\right) \\  \vdots & \vdots                             & \vdots \\  1      & \cos\left(\tfrac{2\pi\cdot 76}{76}\right) & \sin\left(\tfrac{2\pi\cdot 152}{76}\right)  \end{pmatrix}\qquad} \mathrm{V} \scriptsize =  \begin{pmatrix} \cos\left(\tfrac{2\pi\cdot 19}{76}\right)   & \sin\left(\tfrac{2\pi\cdot 19}{76}\right)   & \cos\left(\tfrac{2\pi\cdot 38}{76}\right)\\ \cos\left(\tfrac{2\pi\cdot 38}{76}\right)  & \sin\left(\tfrac{2\pi\cdot 38}{76}\right)  & \cos\left(\tfrac{2\pi\cdot 76}{76}\right)\\ \vdots                            & \vdots \\ \cos\left(\tfrac{2\pi 1444}{76}\right) & \sin\left(\tfrac{2\pi\cdot 1444}{76}\right) & \cos\left(\tfrac{2\pi\cdot 2888}{76}\right) \end{pmatrix}.$$This fundamental FDSLRM property allows us to apply many results and mathematical techniques ofLMM methodology. In the language of LMM terminology $\boldsymbol{\beta}$ represents the vector of fixed effects, the random component depends on vector $\mathbf{Y}$ of random effects and $\boldsymbol{w}$ of random errors.From the viewpoint of LMM residual analysis, we have to consider three types of residuals:   * _marginal residuals_ (FDSLRM residuals): $\mathbf{X}-\mathrm{F}{\boldsymbol{\beta^*}}$, * _random effects residuals_ (FDS residuals): $\mathrm{V}{\mathbf{Y^*}}$,  * _conditional residuals_ (WN residuals): $\mathbf{X}-\mathrm{F}{\boldsymbol{\beta^*}}-\mathrm{V}{\mathbf{Y^*}}$.   *How was the final form of $\mathrm{F}$ and $\mathrm{V}$ found?*Due to the LMM structure,  we can apply graphical (exploratory) tools and quantitative tests of LMM residual diagnostics (*Singer et al., 2017*) for FDSLRM observations (see the next subsection **_Graphical tools_**). The most suitable form of $\mathrm{F}$ and $\mathrm{V}$ is found by an iterative process (see rules and steps explained in the next remark) of applying the mentioned tools whose results are summarized in the following table. Two most adequate and parsimonious structures of the FDSLRM (2b, 3b) consist of two low frequencies $(2\pi/76, 2\pi\cdot 2/76)$ and two higher ones $(2\pi\cdot 19/76, 2\pi\cdot 38/76)$. Since the difference in AIC, BIC for both models is relatively small, our final choice is *_model 3b_* thanks to the generally smaller mean squared error in predictions (*Hančová, 2007*).  .tg  {border-collapse:collapse;border-spacing:0;}.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}.tg .tg-baqh{text-align:center;vertical-align:top}.tg .tg-c3ow{border-color:inherit;text-align:center;vertical-align:top}      Iterationnumber    Graphical diagnostic tools    Numerical diagnostic tests    Frequencies (raw) in model*            L    O1    H    O2    ACF    PACF    N1    N2    N3    Normalitytest    Independencetest    $\dfrac{1}{76}$    $\dfrac{2}{76}$    $\dfrac{19}{76}$    $\dfrac{38}{76}$        1.    $\checkmark$    $\checkmark$    $\checkmark$    ?    $\checkmark$    $\checkmark$    ?    ?    $\checkmark$    $\checkmark$    $\times$    -    T,1,1    T,1,1    R,1,1        2a.    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    ?    $\times$    $\checkmark$    $\checkmark$    T,1,1    T,1,1    T,1,1    R,1,1        2b.    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    T,1,0    T,0,1    T,0,1    R,1,0        3a.    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\times$    ?    ?    $\checkmark$    $\checkmark$    T,1,1    T,1,1    R,1,1    R,1,1        3b.    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    $\checkmark$    ?    $\checkmark$    $\checkmark$    $\checkmark$    T,1,0    T,0,1    R,1,1    R,1,0   *Coding: letter (T or R) $-$ presence of the frequency in the trend or random component; the first number (1 or 0) $-$ presence  of the frequency in the cos term; the second number (1 or 0) $-$ in the sin term  > **Key rules and steps of the iterative econometric FDSLRM-building**  >General rules of the FDSLRM-building for econometric data (*Štulajter, 2002*; *Box et al, 2016*; *Gajdoš et al., 2017*): - the model should be parsimonious (in the form of a simple dependence with a small number of the parameters),- the model should create small unexplained (random) deviations (small variances, covariances or mean squared errors),- the model should include lower frequencies in the trend component, and higher ones in the random component.>>Key steps of the FDSLRM-building for econometric data (our experience): - follow the scheme of the Box-Jenkins iterative, three-stage time series model-building approach: formulation (identification), estimation (fit), diagnostic (checking),- the more apparent periodic or seasonal patterns in the data mean the smaller number of iterations in the model building,- start at least with the three most significant frequencies in the model, - use the graphical-tools diagnostic matrix and numerical tests (see below) to check the adequacy of the model,- remove or add other significant frequencies and check the model adequacy,- remove cos or sin term with a particular frequency and check the model adequacy,- very small or very big variance parameter estimates indicate a reason to remove the corresponding cos or sin term with a particular frequency in the random component,- very small predictions of random effects also indicate an exclusion of the corresponding term in the random component,- use information criteria AIC, BIC to choose between competing adequate models.   Graphical (exploratory) tools >In the LMM residual analysis for FDSLRM we can use the following matrix of graphical exploratory tools (plots) as diagnostic tools for all FDSLRM assumptions. A brief description of the tools is in the **_Appendix_**.>>|$ $|$\large\mbox{Graphical-tools diagnostic matrix}$|$ $||---|------------------------------------------------|---| |   |   |$\mbox{linearity of fixed effects (L)}$| $\mbox{outlying observations (O1)}\hspace{0.75cm}$ | $\mbox{independence of cond. errors (ACF)} $ ||**stand. marg. residuals vs marg. fitted values**|**stand. marg. residuals vs times**$\hspace{0.75cm}$|**ACF of cond. residuals**||   |  |$\mbox{homoscedascity of cond. errors (H)}$|$\mbox{outlying observations (O2)}\hspace{0.75cm}$|$\mbox{independence of cond. errors (PACF)} $ ||**stand. cond. residuals vs cond. predictions**|**stand. cond. residuals vs times**$\hspace{0.75cm}$|**PACF of cond. residuals**||   | |$\mbox{normality of cond. errors (N1)}$|$\mbox{normality of cond. errors (N2)}\hspace{0.75cm}$|$\mbox{normality of cond. errors (N3)} $ ||**histogram of cond. residuals**|**histogram of stand. least conf. residuals**$\hspace{0.75cm}$|**stand. least conf. residuals vs $\mathcal{N}(0,1)$ quantiles**|We present the residual diagnostics results for the final model (3b).<jupyter_code># Fitting the final FDSLRM
output <- fitDiagFDSLRM(dt, t, c(1/76, 2/76), include_fixed_eff = c(1,0,0,1), 
                          freq_random = c(19/76, 38/76), include_random_eff = c(1,1,1,0),
                          poly_trend_degree = 0, season_period = 4)

options(repr.plot.res=600, repr.plot.height=9, repr.plot.width=10)
drawDiagPlots("all", output)<jupyter_output><empty_output><jupyter_text>Single panels for diagnosticOur function `drawDiagPlots()` also allows to show any of diagnostic plots above in a single panel. Here we show two additional plots (not included in the Graphical-tools diagnostic matrix).* plot: **cumulative periodogram of conditional residuals** - detection of periodic nonrandomness in conditional residuals* plot: **standardized marginal residuals vs marginal fitted values** - test of linearity of fixed effects<jupyter_code>options(repr.plot.res=80, repr.plot.height=6, repr.plot.width=6)
drawDiagPlots(output$diagnostic_plots_names$CumulatPeriodogCondResid, output)
options(repr.plot.res=100, repr.plot.height=5, repr.plot.width=7)
drawDiagPlots(output$diagnostic_plots_names$StdMarginalResidVsFittedValues, output)<jupyter_output><empty_output><jupyter_text>Numerical tests  Tests of residual independence<jupyter_code>print(output$Box_test_season_resid)
print(output$BoxLjung_test_season_resid)<jupyter_output>Box-Pierce test

data:  resid(fit)
X-squared = 3.3683, df = 8, p-value = 0.9092


	Box-Ljung test

data:  resid(fit)
X-squared = 3.6515, df = 8, p-value = 0.8871<jupyter_text>Test of residual normality<jupyter_code>print(output$ShapiroWilk_test_norm_cond_resid)
print(output$ShapiroWilk_test_stand_least_conf_resid)<jupyter_output>Shapiro-Wilk normality test

data:  resid(fit, type = "normalized")
W = 0.98015, p-value = 0.2796


	Shapiro-Wilk normality test

data:  SingerEtAl_resid_diag$least.confounded.residuals
W = 0.97934, p-value = 0.2747<jupyter_text>| [Table of Contents](table_of_contents) | [Data and model](data_and_model) | [Modeling](modeling) | [Residual diagnostics](residual_diagnostics) | [Fitting summary](fitting_summary) | [Session info](session_info) | [References](references) | [Appendix - Tools, R functions](appendix) | ***  Fitting summary   Parameter estimates  Estimates of regression coefficients<jupyter_code>drawTable(type = "fixed", fixed_eff = output$fixed_effects)<jupyter_output><empty_output><jupyter_text>Predictions of random effects<jupyter_code>drawTable(type = "random", random_eff = output$random_effects)<jupyter_output><empty_output><jupyter_text>Estimates of variance parameters<jupyter_code>drawTable(type = "variance", variances = c(output$error_variance, diag(output$rand_eff_variance)))<jupyter_output><empty_output><jupyter_text>Fit summary  Graphical  summary for the final model (3b)* plot: **time series observations (black), fitted values (blue), estimated trend (red) vs times**<jupyter_code>options(repr.plot.res=120, repr.plot.height=5, repr.plot.width=6.5)
drawDiagPlots(output$diagnostic_plots_names$FittedTimeSeries, output)<jupyter_output><empty_output><jupyter_text>Numerical summary for the final model (3b)<jupyter_code>print(output$fit_summary)<jupyter_output>Linear mixed-effects model fit by REML
 Data: d 
       AIC      BIC    logLik
  77.54945 93.58267 -31.77472

Random effects:
 Formula: ~-1 + v1 + v2 + v3 | g
 Structure: Diagonal
                v1        v2        v3  Residual
StdDev: 0.03274389 0.4769492 0.1444184 0.3281277

Fixed effects: as.formula(paste("x~", paste(names(d)[2:kk], collapse = "+"))) 
                Value  Std.Error DF   t-value p-value
(Intercept)  4.253501 0.03763883 73 113.00833       0
f2           0.255671 0.05322934 73   4.80320       0
f3          -0.247357 0.05322934 73  -4.64701       0
 Correlation: 
   (Intr) f2
f2 0        
f3 0      0 

Standardized Within-Group Residuals:
        Min          Q1         Med          Q3         Max 
-2.77665527 -0.68958989 -0.04928173  0.57724936  2.19774297 

Number of Observations: 76
Number of Groups: 1<jupyter_text>Numerical summary for model 2b<jupyter_code># AIC, BIC, loglike for model 2b
output2b <- fitDiagFDSLRM(dt, t, c(1/76, 2/76, 19/76), include_fixed_eff = c(1,0,0,1,0,1), 
                          freq_random = c(38/76), include_random_eff = c(1,0),
                          poly_trend_degree = 0, season_period = 4)

print(output2b$fit_summary)<jupyter_output>Linear mixed-effects model fit by REML
 Data: d 
      AIC     BIC   logLik
  74.2364 87.8964 -31.1182

Random effects:
 Formula: ~-1 + v1 | g
               v1 Residual
StdDev: 0.1443915 0.329001

Fixed effects: as.formula(paste("x~", paste(names(d)[2:kk], collapse = "+"))) 
                Value  Std.Error DF   t-value p-value
(Intercept)  4.253501 0.03773901 72 112.70834       0
f2           0.255671 0.05337102 72   4.79045       0
f3          -0.247357 0.05337102 72  -4.63468       0
f4           0.479902 0.05337102 72   8.99182       0
 Correlation: 
   (Intr) f2 f3
f2 0           
f3 0      0    
f4 0      0  0 

Standardized Within-Group Residuals:
        Min          Q1         Med          Q3         Max 
-2.75118551 -0.70235938 -0.03079806  0.59381584  2.17636294 

Number of Observations: 76
Number of Groups: 1<jupyter_text>| [Table of Contents](table_of_contents) | [Data and model](data_and_model) | [Modeling](modeling) | [Residual diagnostics](residual_diagnostics) | [Fitting summary](fitting_summary) | [Session info](session_info) | [References](references) | [Appendix - Tools, R functions](appendix) | ***  Session info<jupyter_code>print(sessionInfo())<jupyter_output>R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] CVXR_0.99-5      pracma_2.2.5     gnm_1.1-0        sommer_3.9.3    
 [5] crayon_1.3.4     lattice_0.20-38  matrixcalc_1.0-3 fpp2_2.3        
 [9] expsmooth_2.3    fma_2.3          ggplot2_3.1.1    forecast_8.7    
[13] nlme_3.1-139     car_3.0-2        carData_3.0-2    Matrix_1.2-17   
[17] MASS_7.3-51.4    IRdisplay_0.7.0  kableExtra_1.1.0 fdslrm_0.1.0    

loaded via a namespace (and not attached):
 [1] xts_0.11-2        scs_1.2-3         bit64_0.9-7       webshot_0.5.1    
 [5] httr_1.4.0        r[...]
{'fraction_non_alphanumeric': 0.133952652082709, 'fraction_numerical': 0.053341324543002694, 'mean_word_length': 4.198041833555852, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 77, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '16', 'dir': 'jupyter-structured-clean-dedup', 'id': '33235', 'license': 'MIT', 'n_tokens_mistral': 8381, 'n_tokens_neox': 7449, 'n_words': 2277, 'path': 'notebooks/Tourism.ipynb', 'repo_name': 'fdslrm/applications', 'size': '23455'}