stat157 / background

0 stars 4 forks source link

Error Analyzer PseudoCode #40

Open bonghyun5 opened 11 years ago

bonghyun5 commented 11 years ago

This is a psudoCode to generate the Error Diagram in R. This is for Analyzer group 3 + 1

Function to generate error diagram

data = Earth Quake Data

params = parameter for the ETAS Function

plotErrorDiagram = function(data, params) { CI_Dist = #Generate Estimated Confidence Interval Distance for timeperiod of interest using the ETAS function and appropriate Parameters CI_List = #Generate Confidence Interval Distance for each of the earthquake data points using the ETAS function and appropriate Parameters

Generate error point given specific confidence interval

errorPoint = sapply(CI_Dist, function(ci) {mean(CI_List > ci)} timePeriod = #Sequence of Time Period

Generates the plot for the error diagram

plot(seq(0,1,length(timePeriod)), errorPoint[timePeriod],type = "l", xlab=expression(tau), ylab=expression(nu),main = "Training set Error Diagram", col="red") }

etasMode = function(params) {

Simply implement the ETAS Model.

}