The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Type: Package
Title: Spatial Regression Models with Compositional Data
Version: 1.0
Date: 2025-10-17
Author: Michail Tsagris [aut, cre]
Maintainer: Michail Tsagris <mtsagris@uoc.gr>
Depends: R (≥ 4.0)
Imports: blockCV, Compositional, doParallel, foreach, minpack.lm, parallel, Rfast, sf, stats
Suggests: Rfast2
Description: Spatial regression models with compositional responses using the alpha–transformation. Relevant papers include: Tsagris M. (2025), <doi:10.48550/arXiv.2510.12663>, Tsagris M. (2015), https://soche.cl/chjs/volumes/06/02/Tsagris(2015).pdf, Tsagris M.T., Preston S. and Wood A.T.A. (2011), <doi:10.48550/arXiv.1106.1451>.
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
LazyData: true
NeedsCompilation: no
Packaged: 2025-10-20 15:58:50 UTC; mtsag
Repository: CRAN
Date/Publication: 2025-10-23 13:50:08 UTC

Spatial Regression Models with Compositional Data

Description

Spatial regression models with compositional responses using the \alpha–transformation. The models includes are the \alpha-regression (not spatial), the \alpha-spatially lagged X (\alpha-SLX) model and the geographically weighted \alpha-regression (GW\alphaR) model.

Details

Package: CompositionalSR
Type: Package
Version: 1.0
Date: 2025-10-17
License: GPL-2

Maintainers

Michail Tsagris <mtsagris@uoc.gr>

Author(s)

Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf


Computation of the contiguity matrix W

Description

Computation of the contiguity matrix W.

Usage

contiguity(coords, k = 10)

Arguments

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

k

The number of nearest neighbours to consider for the contiguity matrix.

Value

The contiguity matrix W. A square matrix with row standardised values (the elements of each row sum to 1).

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

See Also

alfa.slx, cv.alfaslx, me.aslx

Examples

data(fadn)
W <- contiguity(fadn[, 1:2])

Leave-one-out cross-validation for the GW\alphaR model

Description

Leave-one-out cross-validation for the GW\alphaR model

Usage

cv.gwar(y, x, a = c(0.1, 0.25, 0.5, 0.75, 1), coords, h, nfolds = 10, folds = NULL)

Arguments

y

A matrix with compositional data. zero values are allowed.

x

A matrix with the continuous predictor variables or a data frame including categorical predictor variables.

a

The value of the power transformation, it has to be between -1 and 1. If zero values are present it has to be greater than 0. If \alpha=0 the isometric log-ratio transformation is applied.

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

h

A vector with bandwith values.

nfolds

The number of folds to split the data.

folds

If you have the list with the folds supply it here. You can also leave it NULL and it will create folds.

Details

The \alpha-transformation is applied to the compositional data and the numerical optimisation is performed for the regression, unless \alpha=0, where the coefficients are available in closed form.

Value

A list including:

runtime

The runtime required by the cross-validation.

perf

A matrix with the Kullback-Leibler divergence of the observed from the fitted values. Each row corresponds to a value of \alpha and each column to a value of h.

opt

A vector with the minimum Kullback-Leibler divergance, the optimal value of \alpha and h.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

gwar, me.gwar cv.alfaslx

Examples

data(fadn)
coords <- fadn[, 1:2]
y <- fadn[, 3:7]
x <- fadn[, 8]
mod <- gwar(y, x, a = 1, coords, h = 0.001)

Leave-one-out cross-validation for the \alpha-SLX model

Description

Leave-one-out cross-validation for the \alpha-SLX model

Usage

cv.alfaslx(y, x, a = seq(0.1, 1, by = 0.1), coords, k = 2:15, nfolds = 10, folds = NULL)

Arguments

y

A matrix with compositional data. zero values are allowed.

x

A matrix with the continuous predictor variables or a data frame including categorical predictor variables.

a

The value of the power transformation, it has to be between -1 and 1. If zero values are present it has to be greater than 0. If \alpha=0 the isometric log-ratio transformation is applied.

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

k

A vector with the nearest neighbours to consider for the contiguity matrix.

nfolds

The number of folds to split the data.

folds

If you have the list with the folds supply it here. You can also leave it NULL and it will create folds.

Details

The \alpha-transformation is applied to the compositional data and the numerical optimisation is performed for the regression, unless \alpha=0, where the coefficients are available in closed form.

Value

A list including:

runtime

The runtime required by the cross-validation.

perf

A vector with the Kullback-Leibler divergence of the observed from the fitted values. Every value corresponds to a value of \alpha.

opt

A vector with the minimum Kullback-Leibler divergence, the optimal value of \alpha and k.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

alfa.slx, cv.gwar cv.alfareg

Examples

data(fadn)
coords <- fadn[1:100, 1:2]
y <- fadn[1:100, 3:7]
x <- fadn[1:100, 8]
mod <- cv.alfaslx(y, x, a = 0.5, coords, k = 2)

Marginal effects for the GW\alphaR model

Description

Marginal effects for the GW\alphaR model.

Usage

me.gwar(be, mu, x)

Arguments

be

A matrix with the beta regression coefficients of the \alpha-regression model.

mu

The fitted values of the \alpha-regression.

x

A matrix with the continuous predictor variables or a data frame. Categorical predictor variables are not suited here.

Details

The location-specific marginal effects for the GW\alphaR model are computed.

Value

A list including:

me

An array with the location-specific marginal effects of each component for each predictor variable.

ame

The average location-specific marginal effects of each component for each predictor variable.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

gwar, me.aslx, me.ar

Examples

data(fadn)
coords <- fadn[, 1:2]
y <- fadn[, 3:7]
x <- fadn[, 8]
mod <- gwar(y, x, a = 1, coords, h = 0.001)
me <- me.gwar(mod$be, mod$est, x)

Marginal effects for the \alpha-SLX model

Description

Marginal effects for the \alpha-SLX model.

Usage

me.aslx(be, gama, mu, x, coords, k = 10, cov_theta = NULL)

Arguments

be

A matrix with the beta coefficients of the \alpha-SLX model.

gama

A matrix with the gamma coefficients of the \alpha-SLX model.

mu

The fitted values of the \alpha-SLX model.

x

A matrix with the continuous predictor variables or a data frame. Categorical predictor variables are not suited here.

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

k

The number of nearest neighbours to consider for the contiguity matrix.

cov_theta

The covariance matrix of the beta and gamma regression coefficients. If you pass this argument, then the standard error of the average marginal effects will be returned.

Details

The \alpha-transformation is applied to the compositional data first and then the \alpha-SLX model is applied.

Value

A list including:

me.dir

An array with the direct marginal effects of each component for each predictor variable.

me.indir

An array with the indirect marginal effects of each component for each predictor variable.

me.total

An array with the total marginal effects of each component for each predictor variable.

ame.dir

An array with the average direct marginal effects of each component for each predictor variable.

ame.indir

An array with the average indirect marginal effects of each component for each predictor variable.

ame.total

An array with the aerage total marginal effects of each component for each predictor variable.

se.amedir

An array with the standard errors of the average direct marginal effects of each component for each predictor variable. This is returned if you supply the covariance matrix cov_theta.

se.ameindir

An array with the standard errors of the average indirect marginal effects of each component for each predictor variable. This is returned if you supply the covariance matrix cov_theta.

se.ametotal

An array with the standard errors of the average total marginal effects of each component for each predictor variable. This is returned if you supply the covariance matrix cov_theta.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

me.gwar, me.ar, alfa.slx

Examples

data(fadn)
coords <- fadn[, 1:2]
y <- fadn[, 3:7]
x <- fadn[, 8]
mod <- alfa.slx(y, x, a = 0.5, coords, k = 10, xnew = x, coordsnew = coords)
me <- me.aslx(mod$be, mod$gama, mod$est, x, coords, k = 10)

Marginal effects for the \alpha-regression model

Description

Marginal effects for the \alpha-regression model.

Usage

me.ar(be, mu, x, cov_be = NULL)

Arguments

be

A matrix with the beta regression coefficients of the \alpha-regression model.

mu

The fitted values of the \alpha-regression.

x

A matrix with the continuous predictor variables or a data frame. Categorical predictor variables are not suited here.

cov_be

The covariance matrix of the beta regression coefficients. If you pass this argument, then the standard error of the average marginal effects will be returned.

Details

The \alpha-transformation is applied to the compositional data first and then the \alpha-regression model is applied.

Value

A list including:

me

An array with the marginal effects of each component for each predictor variable.

ame

The average marginal effects of each component for each predictor variable.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

me.aslx, me.gwar, alfa.reg

Examples

data(fadn)
y <- fadn[, 3:7]
x <- fadn[, 8]
mod <- alfa.reg(y, x, 0.2, xnew = x)
me <- me.ar(mod$be, mod$est, x)

Prediction with the GW\alphaR model

Description

Prediction with GW\alphaR model.

Usage

gwar.pred(y, x, a, coords, h, xnew, coordsnew)

Arguments

y

A matrix with the compositional data.

x

A matrix with the continuous predictor variables or a data frame including categorical predictor variables.

a

A vector with values for the power transformation, it has to be between -1 and 1.

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

h

A vector with bandwith values.

xnew

The new data.

coordsnew

A matrix with the coordinates of the new locations. The first column is the latitude and the second is the longitude.

Details

The \alpha-transformation is applied to the compositional data first and then the GW\alphaR model is applied and predictions are given for each observation.

Value

A list including:

runtime

The time required by the regression.

est

A list with the fitted values, for each combination of \alpha and h.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

cv.gwar, me.gwar, alfa.slx, alfa.reg

Examples

data(fadn)
coords <- fadn[-c(1:10), 1:2]
y <- fadn[-c(1:10), 3:7]
x <- fadn[-c(1:10), 8]
xnew <- fadn[1:10, 8]
coordsnew <- fadn[1:10, 1:2]
mod <- gwar.pred(y, x, a = c(0.25, 0.5, 1), coords,
h = c(0.002, 0.006), xnew = xnew, coordsnew = coordsnew)

Regression with compositional data using the \alpha-transformation

Description

Regression with compositional data using the \alpha-transformation.

Usage

alfa.reg(y, x, a, covb = FALSE, xnew = NULL, yb = NULL)
alfa.reg2(y, x, a, xnew = NULL)

Arguments

y

A matrix with the compositional data.

x

A matrix with the continuous predictor variables or a data frame including categorical predictor variables.

a

The value of the power transformation, it has to be between -1 and 1. If zero values are present it has to be greater than 0. If \alpha=0 the isometric log-ratio transformation is applied and the solution exists in a closed form, since it the classical mutivariate regression. For the alfa.reg2() this should be a vector of \alpha values and the function call repeatedly the alfa.reg() function. For the alfa.reg3() function it should be a vector with two values, the endpoints of the interval of \alpha. This function searches for the optimal vaue of \alpha that minimizes the sum of squares of the errors. Using the optimize function it searches for the optimal value of \alpha. Instead of choosing the value of \alpha using cv.alfareg (that uses cross-validation) one can select it this way.

covb

If this is FALSE, the covariance matrix of the coefficients will not be returned. If however you set it equal to TRUE and the covariance matrix is not returned it means it was singular.

xnew

If you have new data use it, otherwise leave it NULL.

yb

If you have already transformed the data using the \alpha-transformation with the same \alpha as given in the argument "a", put it here. Othewrise leave it NULL.

This is intended to be used in the function cv.alfareg in order to speed up the process. The time difference in that function is small for small samples. But, if you have a few thousands and or a few more components, there will be bigger differences.

Details

The \alpha-transformation is applied to the compositional data first and then multivariate regression is applied. This involves numerical optimisation. The alfa.reg2() function accepts a vector with many values of \alpha, while the the alfa.reg3() function searches for the value of \alpha that minimizes the Kulback-Leibler divergence between the observed and the fitted compositional values. The functions are highly optimized.

Value

For the alfa.reg() function a list including:

runtime

The time required by the regression.

be

The beta coefficients.

covb

The covariance matrix of the beta coefficients, or NULL if it is singular.

est

The fitted values for xnew if xnew is not NULL.

For the alfa.reg2() function a list with as many sublists as the number of values of \alpha. Each element (sublist) of the list contains the beta coefficients and the fitted values.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

Mardia K.V., Kent J.T., and Bibby J.M. (1979). Multivariate analysis. Academic press.

Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.

See Also

cv.alfareg, alfa.slx

Examples

data(fadn)
y <- fadn[, 3:7]
x <- fadn[, 8]
mod <- alfa.reg(y, x, 0.2)

Spatial k-folds

Description

Spatial k-folds.

Usage

spat.folds(coords, nfolds = 10)

Arguments

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

nfolds

The number of spatial folds to create.

Details

Folds of data are created based on their coordinates. For more information see the package blockCV.

Value

A list with nfolds elements. Each elements contains a list with two elements, the first is the indices of the training set and the second contains the indices of the test set.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

See Also

cv.alfaslx, me.aslx, gwar, alfa.reg

Examples

data(fadn)
coords <- fadn[, 1:2]
folds <- spat.folds(coords, nfolds = 10)

The GW\alphaR model

Description

The GW\alphaR model.

Usage

gwar(y, x, a, coords, h, yb = NULL, nc = 1)

Arguments

y

A matrix with the compositional data.

x

A matrix with the continuous predictor variables or a data frame including categorical predictor variables.

a

The value of the power transformation, it has to be between -1 and 1.

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

h

The bandwith value.

yb

If you have already transformed the data using the \alpha-transformation with the same \alpha as given in the argument "a", put it here. Othewrise leave it NULL.

nc

The number of cores to use. IF you have a multicore computer it is advisable to use more than 1. It makes the procedure faster. It is advisable to use it if you have many observations and or many variables, otherwise it will slow down th process.

Details

The \alpha-transformation is applied to the compositional data first and then the GW\alphaR model is applied.

Value

A list including:

runtime

The time required by the regression.

be

The beta coefficients.

est

The fitted values.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

cv.gwar, me.gwar, alfa.slx, alfa.reg

Examples

data(fadn)
coords <- fadn[, 1:2]
y <- fadn[, 3:7]
x <- fadn[, 8]
mod <- gwar(y, x, a = 1, coords, h = 0.001)

The \alpha-SLX model

Description

The \alpha-SLX model.

Usage

alfa.slx(y, x, a, coords, k = 10, covb = FALSE, xnew = NULL, coordsnew, yb = NULL)

Arguments

y

A matrix with the compositional data.

x

A matrix with the continuous predictor variables or a data frame including categorical predictor variables.

a

The value of the power transformation, it has to be between -1 and 1. If zero values are present it has to be greater than 0. If \alpha=0 the isometric log-ratio transformation is applied and the solution exists in a closed form, since it the classical mutivariate regression.

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

k

The number of nearest neighbours to consider for the contiguity matrix.

covb

If this is FALSE, the covariance matrix of the coefficients will not be returned. If however you set it equal to TRUE and the covariance matrix is not returned it means it was singular.

xnew

If you have new data use it, otherwise leave it NULL.

coordsnew

A matrix with the coordinates of the new locations. The first column is the latitude and the second is the longitude. If you do not have new data to make predictions leave this NULL.

yb

If you have already transformed the data using the \alpha-transformation with the same \alpha as given in the argument "a", put it here. Othewrise leave it NULL.

This is intended to be used in the function cv.alfareg in order to speed up the process. The time difference in that function is small for small samples. But, if you have a few thousands and or a few more components, there will be bigger differences.

Details

The \alpha-transformation is applied to the compositional data first and then the spatially lagged X (SLX) model is applied.

Value

A list including:

runtime

The time required by the regression.

be

The beta coefficients.

gama

The gamma coefficients.

covb

The covariance matrix of the beta coefficients, or NULL if it is singular. If it is returned, the upper left block is the covariance matrix of the beta coefficients and the lower right block is the covariance matrix of the gama coefficients. It is in this way so as to pass it on to the marginal effects function me.aslx, if necessary.

est

The fitted values for xnew if xnew is not NULL.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

cv.alfaslx, me.aslx, gwar, alfa.reg

Examples

data(fadn)
coords <- fadn[, 1:2]
y <- fadn[, 3:7]
x <- fadn[, 8]
mod <- alfa.slx(y, x, a = 0.5, coords, k = 10)

Tuning the value of \alpha in the \alpha-regression

Description

Tuning the value of \alpha in the \alpha-regression.

Usage

cv.alfareg(y, x, a = seq(0.1, 1, by = 0.1), nfolds = 10,
folds = NULL, nc = 1, seed = NULL)

Arguments

y

A matrix with compositional data. zero values are allowed.

x

A matrix with the continuous predictor variables or a data frame including categorical predictor variables.

a

The value of the power transformation, it has to be between -1 and 1. If zero values are present it has to be greater than 0. If \alpha=0 the isometric log-ratio transformation is applied.

nfolds

The number of folds to split the data.

folds

If you have the list with the folds supply it here. You can also leave it NULL and it will create folds.

nc

The number of cores to use. IF you have a multicore computer it is advisable to use more than 1. It makes the procedure faster. It is advisable to use it if you have many observations and or many variables, otherwise it will slow down th process.

seed

You can specify your own seed number here or leave it NULL.

Details

Tuning the value of \alpha in the \alpha-regression takes place using k-fold cross-validation.

Value

A list including:

runtime

The runtime required by the cross-validation.

perf

A vector with the Kullback-Leibler divergence of the observed from the fitted values. Every value corresponds to a value of \alpha.

opt

A vector with the minimum Kullback-Leibler divergence and the optimal value of \alpha.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Tsagris M. (2025). The \alpha–regression for compositional data: a unified framework for standard, spatially-lagged, and geographically-weighted regression models. https://arxiv.org/pdf/2510.12663

Tsagris M. (2015). Regression analysis with compositional data containing zero values. Chilean Journal of Statistics, 6(2): 47-57. https://arxiv.org/pdf/1508.01913v1.pdf

Tsagris M.T., Preston S. and Wood A.T.A. (2011). A data-based power transformation for compositional data. In Proceedings of the 4th Compositional Data Analysis Workshop, Girona, Spain. https://arxiv.org/pdf/1106.1451.pdf

See Also

alfa.reg, cv.alfaslx, cv.gwar, me.ar

Examples

data(fadn)
y <- fadn[, 3:7]
x <- fadn[, 8]
mod <- cv.alfareg(y, x, a = c(0.5, 1))

FADN dataset

Description

A matrix with 11 columns. The first two are the locations (latitude and longitude), the next five contain the compositional data (percentages of cultivated area of five crops), Y1.1: cereals, Y2.1: cotton, Y3.1: tree crops, Y4.1: other annual crops and pasture and Y5.1: grapes and wine. The next four columns contain the covariates, G1: Human Influence Index, G2: soil pH, G3: topsoil organic carbon content and G7: erosion.

Usage

fadn

Format

A matrix with 168 rows and 11 columns.

Source

Clark and Dixon (2021), available at https://github.com/nick3703/Chicago-Data.

References

Clark, N. J. and P. M. Dixon (2021). A class of spatially correlated self-exciting statistical models. Spatial Statistics, 43, 1–18.

See Also

alfa.slx, gwar, alfa.reg

Examples

data(fadn)
y <- fadn[, 3:7]
x <- fadn[, 8:11]
mod <- alfa.reg(y, x, a = 0.1)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.