Description Usage Arguments Details See Also Examples

View source: R/graphrate.fun.r

This function calculates the empirical and the cumulative fitted occurrence rate of a PP on overlapping or disjoint intervals and plot them versus time.

1 2 3 |

`objres` |
Optional. A list with (at least) elements fittedlambda, emplambda, t,
and typeI.
For example, the output from |

`fittedlambda` |
Optional. Numeric vector of the cumulative
fitted intensities |

`emplambda` |
Optional. Numeric vector of the empirical PP occurrence rates estimated over the considered intervals (usually divided by the length of the interval). |

`t` |
Optional. Time vector of the PP observation period. |

`lint` |
Optional. Length of the intervals used to calculate the empirical and the (cumulative) fitted occurrence intensities. |

`typeI` |
Label indicating the type ('Overlapping' or 'Disjoint') of the intervals. |

`tit` |
Character string. A title for the plot. |

`scax` |
Optional. Vector of two values giving the range of values for the x-axis. An adequate range is selected by default. |

`scay` |
Optional. Vector of two values giving the range of values for the y-axis. An adequate range is selected by default. |

`xlegend` |
Label indicating the position where the legend on the graph will be located. |

`histWgraph` |
Logical flag. If it is TRUE, a new graphical device is opened
with the option |

Either the argument objres or the set of arguments (fittedlambda, emplambda, t) must be specified. If objres is provided, fittedlambda, emplambda, t,lint and typeI are ignored.

In order to make comparable the empirical and the fitted occurrence rates, a cumulative fitted rate must be used. That means that argument fittedlambda must be the sum of the intensities fitted by the model over the same interval where the empirical rates have been calculated.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
##plot of rates based on overlapping intervals
graphrate.fun(emplambda=runif(500,0,1), fittedlambda=runif(500,0,1),
t=c(1:500), lint=100, tit="Example", typeI="Overlapping")
#plot of rates based on disjoint intervals
graphrate.fun(emplambda=runif(50,0,1), fittedlambda=runif(50,0,1),
t=c(1:50), lint=10, tit="Example", typeI="Disjoint")
#Example using objres as input. In this example X1 has no influence on the rate;
#consequently the fitted rate is almost a constant.
X1<-rnorm(1000)
modE<-fitPP.fun(tind=TRUE,covariates=cbind(X1),
posE=round(runif(40,1,1000)), inddat=rep(1,1000),
tim=c(1:1000), tit="Simulated example", start=list(b0=1,b1=0),
modCI=FALSE,modSim=TRUE,dplot=FALSE)
ResDE<-CalcResD.fun(mlePP=modE,lint=50)
graphrate.fun(ResDE, tit="Example")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.