# WlsInit: Computes Starting Values based on Weighted Least Squares In CompRandFld: Composite-Likelihood Based Analysis of Random Fields

## Description

Subroutine called by FitComposite. The function returns opportune starting values for the composite-likelihood fitting procedure based on weigthed least squares.

## Usage

 ```1 2 3 4``` ```WlsInit(coordx, coordy, coordt, corrmodel, data, distance, fcall, fixed, grid, likelihood, margins, maxdist, maxtime, model, numblock, param, parscale, paramrange, replicates, start, taper, tapsep, threshold, type, varest, vartype, weighted, winconst, winstp) ```

## Arguments

 `coordx` A numeric (d x 2)-matrix (where `d` is the number of points) assigning 2-dimensions of coordinates or a numeric vector assigning 1-dimension of coordinates. `coordy` A numeric vector assigning 1-dimension of coordinates; `coordy` is interpreted only if `coordx` is a numeric vector otherwise it will be ignored. `coordt` A numeric vector assigning 1-dimension of temporal coordinates. `corrmodel` String; the name of a correlation model, for the description. `data` A numeric vector or a (n x d)-matrix or (d x d x n)-matrix of observations. `distance` String; the name of the spatial distance. The default is `Eucl`, the euclidean distance. See the Section Details. `fcall` String; "fitting" to call the fitting procedure and "simulation" to call the simulation procedure. `fixed` A named list giving the values of the parameters that will be considered as known values. `grid` Logical; if `FALSE` (the default) the data are interpreted as a vector or a (n x d)-matrix, instead if `TRUE` then (d x d x n)-matrix is considered. `likelihood` String; the configuration of the composite likelihood. `margins` String; the type of the marginal distribution of the max-stable field. `maxdist` Numeric; an optional positive value indicating the maximum spatial distance considered in the composite-likelihood computation. `maxtime` Numeric; an optional positive value indicating the maximum temporal separation considered in the composite-likelihood computation. `model` String; the name of the model. Here the default is `NULL`. `numblock` Numeric; the observation size of the underlying random field. Only in case of max-stable random fields and in the simulation. `param` A numeric vector of parameter values required in the simulation procedure of random fields. `parscale` A numeric vector with scaling values for improving the maximisation routine. `paramrange` A numeric vector with the range of the parameter space. `replicates` Logical; if `FALSE` (the default) one spatial random field is considered, instead if `TRUE` the data are considered as iid replicates of a field. `start` A numeric vector with starting values. `taper` String; the name of the type of covariance matrix. It can be `Standard` (the default value) or `Tapering` for taperd covariance matrix. `tapsep` Numeric; an optional value indicating the separabe parameter in the space time quasi taper (see Details). `threshold` Numeric; a value indicating a threshold for the binary random field. `type` String; the type of estimation method. `varest` Logical; if `TRUE` the estimates' variances and standard errors are returned. `FALSE` is the default. `vartype` String; the type of estimation method for computing the estimate variances, see the Section Details. `weighted` Logical; if `TRUE` the likelihood objects are weighted, see `FitComposite`. `winconst` Numeric; a positive real value indicating the window size used from the sub-sampling method for the estimation of the parameters variances.

.

 `winstp` Numeric; a value in (0,1] for defining the window step. See `FitComposite`.

## Author(s)

`FitComposite`, `WLeastSquare`.