area.comun: Common area estimation for the SFA-parameters

Description Usage Arguments Value Examples

Description

It lets use the common area method to obtain a robust estimation of the SFA-parameters. This function include the Normal-HalfNormal and Normal-Exponencial models. In addition several options of kernel estimation has been included.

Usage

1
area.comun(x, y, model = "Normal-HalfNormal", method = "Kernel")

Arguments

x

A vector or matrix with the inputs.

y

A vector of outputs

model

The model that we want to suposed. It can be the "Normal-HalfNormal" or "Normal-Exponencial".

method

The method of kernel estimation that we want to use. It can be "Kernel" or "Adaptative-Kernel".

Value

It returns a list with the results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
set.seed(3)
b0<-100
b1<-5
landa<-1
n<-100
sigmav <- sqrt(sigma2v)
sigma2u <- landa^2 * sigma2v
sigmau <- sqrt(sigma2u)
x <- runif(n, 1, 30)
v <- rnorm(n, 0, sigmav)
u <- abs(rnorm(n, 0, sigmau))
e.real <- v - u
y <- b0 + b1 * x + e.real
asim<-skewness(e.real)

l1<-area.comun(x,y,model="Normal-HalfNormal",method='Adaptative-Kernel')$landa_ac
l2<-area.comun(x,y,model="Normal-HalfNormal",method='Kernel')$landa_ac
cat("Para un valor del parámetro =",landa,"los resultados son:","\n","adkernel=",l1,'\n','kernel=',l2)

javiergarcirod/stfa documentation built on May 4, 2019, 6:40 p.m.