Estim_diagnost: Sample estimators' values for different sample sizes

Description Usage Arguments Value Examples

View source: R/estim_diagnostics.R

Description

For every sample size value the function creates a sample and evaluates the estimators Nmc times.

Usage

1
Estim_diagnost(Nmc, s, Inference, packages = NULL)

Arguments

Nmc

number of repetitions

s

numeric vector of sample sizes

Inference

function of s creating a sample and evaluating estimators (see details)

packages

list of packages to pass to foreach loop

Value

data frame with estimators' values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Nmc=400
s<-c(1e2,1e3)

Inference<-function(s){
  rrr<-rnorm(n=s)
  list(Mn=mean(rrr), Sd=sd(rrr))
}
data <- Estim_diagnost(Nmc, s, Inference)
estims_qqplot(data)
estims_boxplot(data)

#
Inference<-function(s){
rrr<-2/0
list(Mn=mean(rrr), Sd=sd(rrr))
}
head(Estim_diagnost(Nmc, s, Inference))

#
Inference<-function(s){
rrr<-rnorm(n=s)
rrr[2]<-"dwq"
list(Mn=mean(rrr), Sd=sd(rrr))
}
head(Estim_diagnost(Nmc, s, Inference))

EstimDiagnostics documentation built on April 17, 2021, 1:08 a.m.