standardfit: Standard utility to perform nonlinear PSD fit

Description Usage Arguments Value See Also Examples

View source: R/LIHNPSD.r

Description

Standard utility to perform nonlinear PSD fit

Usage

1
standardfit(d, r, hist, trace, iter, plotqq, weights, merge_tails)

Arguments

d

A PSD S3 object representing initial guess of the PSD parameters

r

Input log-return series

hist

Input histogram

trace

TRUE/FALSE: turn trace on/off

iter

Maximum number of iterations

plotqq

TRUE/FALSE: Plot intermediate charts oor not

weights

Specify the weights of each component in the nonlinear fit, defaults are 1.

merge_tails

Specify the numbers of data points to merge in both tails when processing histogram

Value

dist

A PSD S3 object representing best nonlinear fit

psdout

The output of optmix/psg function. This is for debugging purpose only.

See Also

LIHNPSD_standardfit_fn

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
  # Load the daily log-return data of DJIA 
  data(szd_logr)

  # Prepare the input data set
  merge_tails <- c(1,3)
  dt <- LIHNPSD_prepare_data(szd_logr, breaks=68, merge_tails=merge_tails)

  # Prepare the input PSD 
  dist <- list( sigma= 0.0036, alpha= 0.9, gamma= 0.0, beta= -0.014 )
  class(dist) <- "LIHNPSD"
  dist <- rawmean(dist)
  dist$location <- 0.00014

  # Invoke the nonlinear fit (This will take some time!)
  #fit <- standardfit(dist, dt$logr, dt$h, trace=1, iter=10,
  #       plotqq=1, weights=list(m3=5,m4=1,qq_df=4), merge_tails=merge_tails )
  
  # The final PSD
  #dist <- fit$dist

LIHNPSD documentation built on May 2, 2019, 9:12 a.m.