Learn R Programming

siland (version 2.0.5)

Bsiland.lik: -(Loglikelihood) as a function of buffer sizes.

Description

Function investigating eventual optimization problems during numerical optimization of function Bsiland by plotting the -(loglikelihhod) against buffer sizes of each landscape variable.

Usage

Bsiland.lik(res, land,data, varnames = NULL, seqd = seq(2, 2000, length = 10))

Value

a ggplot of the -(loglikelihhod) against buffer sizes of each landscape variables.

Arguments

res

an object resulting from Bsiland

land

the object of class sf describing the landscape variable, i.e. the land argument in the call to the Bsiland function that computed res.

data

the dataframe describing response variable and the local variables, i.e. the data argument in the call to the Bsiland function that computed res.

varnames

a vector containing the names (characters) of studied landscape variables. If varnames is NULL (by default), all landscape variables of the res model are considered.

seqd

a vector of buffer sizes (positive values) for which the -loglikelihood is computed.

Author

O. Martin and F. Carpentier

Details

As with all numerical maximisation procedures, optimization problems may arise. The function Bsiland.lik allows to point out possible problems of optimization.

Bsiland.lik plots the -Loglikelihood against buffers sizes. During the Bsiland procedure, the estimation of buffer sizes is made by maximazing the likelihood i.e. by minimizing the -Loglikelihood. The orange horizontal line indicates the minimal value of -Loglikelihood obtained during the estimation (res result). The other continous curves represent the -loglikehood as a function of buffer sizes for each studied landscape variable (considering the other parameters of the model at their estimated value in res). The dotted lines indicate the values of buffer size estimated (res result).

When the minization correctly occurs, the minimal values of the -loglikelihoods for each landscape variable are equal to the value of the estimated minimal -Loglikelihood. This means that the value of each continuous curves is minimal at its intersection with the orange horizontal line. This also means that dotted lines intersect their associated continuous lines at their minimum.

If it is not the case, the minimizing procedure has failed and it is necessary to proceed again with an estimation with different initialisation values. This is possible with the argument init in function Bsiland.

Examples

Run this code
# \donttest{
data(dataSiland)
data(landSiland)
resB=Bsiland(obs~x1+L1+L2,land=landSiland,data=dataSiland)
Bsiland.lik(resB,dataSiland,land=landSiland,varnames=c("L1","L2"),seqd=seq(5,500,length=20))

# Illustration of failed estimation caused by wrong initial values.
# In a such case, the estimation should be done again ,
# by  calling Bsiland with init=c(250,250) for instance.

resB_fail=Bsiland(obs~x1+L1+L2,land=landSiland,data=dataSiland,init=c(2000,2000))
Bsiland.lik(resB_fail,dataSiland,land=landSiland,varnames=c("L1","L2"),seqd=seq(5,3000,length=20))

# }

Run the code above in your browser using DataLab