localgauss: local Gaussian parameters

Description Usage Arguments Details Value References See Also Examples

View source: R/localgauss.R

Description

Routine for estimating local Gaussian parameters based on a sample from the bivariate distribution under consideration. The routine can either estimate local parameters on a grid covering the data controlled by the gsize and hthresh parameters. Otherwise, local Gaussian parameters can be estimated at coordinates specified by the user in xy.mat.

Usage

1
localgauss(x,y,b1=1,b2=1,gsize=15,hthresh=0.001,xy.mat=NULL)

Arguments

x,y

The two data vectors

b1,b2

The bandwidth in the x-direction and y-direction, respectively

gsize

The gridsize (only used if xy.mat is not specified).

hthresh

Gridpoints where a non-parametric density estimate is lower than hthresh are omitted (only used if xy.mat is not specified).

xy.mat

A M times 2 matrix of points where the local parameters are to be estimated.

Details

The objective function is maximized using a modified Newton method. The user should check whether the field eflag in the returned object is zero for all estimates. If not, the optimizer has not converged and the estimates should not be trusted. For more details, see [Reference to article].

Value

S3 object of type localgauss containing the fields:

par.est

M times 5 matrix of parameter estimates, with columns mu1,mu2,sigma1,sigma2,rho.

eflag

M-vector of exitflags from the optimizer. Estimations with exit flags other than 0 should not be trusted.

hessian

The negative Hessian of the objective function.

References

Geir Drage Berentsen, Tore Selland Kleppe, Dag Tjostheim, Introducing localgauss, an R Package for Estimating and Visualizing Local Gaussian Correlation, Journal of Statistical Software, 56(12), 1-18, 2014, doi: 10.18637/jss.v056.i12 See also Tjoestheim, D. and Hufthammer K. O., Local Gaussian correlation: A new measure of dependence, Journal of Econometrics, 172(1),pages 33-48,2013, for a detailed description of local Gaussian correlation.

See Also

localgauss.indtest.

Examples

1
2
3
    x=rnorm(n=1000)
    y=x^2 + rnorm(n=1000)
    lgobj = localgauss(x,y)

localgauss documentation built on Oct. 6, 2021, 5:15 p.m.