Skip to content

Commit

Permalink
Fixed bug in V5.3.0...
Browse files Browse the repository at this point in the history
... which caused R to crash when FieldConfig[1] != FieldConfig[2] due to
wrong initialization of length of Epsilon_rho1_f
  • Loading branch information
James-Thorson committed Nov 12, 2018
1 parent 0ef07ba commit 4a8a78d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1,447 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: VAST
Type: Package
Title: Vector-autoregressive spatio-temporal (VAST) model
Version: 2.0.0
Date: 2018-10-31
Version: 2.0.1
Date: 2018-11-12
Authors@R: person("James","Thorson", email="James.Thorson@noaa.gov", role=c("aut","cre"))
Maintainer: James Thorson <James.Thorson@noaa.gov>
Description: VAST is an R package for conducting spatio-temporal analysis
Expand Down
4 changes: 2 additions & 2 deletions R/Param_Fn.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ function( Version, DataList, RhoConfig=c("Beta1"=0,"Beta2"=0,"Epsilon1"=0,"Epsil
if( "L_omega2_z" %in% names(Return)) Return = Add_factor( List=Return, n_c=DataList$n_c, n_f=DataList$FieldConfig[3], n_i=DataList$n_s, list_names=c("L_omega2_z","Omegainput2_sf"), sd=0 )
if( "L_epsilon2_z" %in% names(Return)) Return = Add_factor( List=Return, n_c=DataList$n_c, n_f=DataList$FieldConfig[4], n_i=DataList$n_s, n_t=DataList$n_t, list_names=c("L_epsilon2_z","Epsiloninput2_sft"), sd=0 )
# Autocorrelation
if( "Epsilon_rho1_f" %in% names(Return)) Return[["Epsilon_rho1_f"]] = rep(0, ncol(Return[["Omegainput1_sf"]]))
if( "Epsilon_rho2_f" %in% names(Return)) Return[["Epsilon_rho2_f"]] = rep(0, ncol(Return[["Omegainput2_sf"]]))
if( "Epsilon_rho1_f" %in% names(Return)) Return[["Epsilon_rho1_f"]] = rep(0, dim(Return[["Epsiloninput1_sft"]])[2])
if( "Epsilon_rho2_f" %in% names(Return)) Return[["Epsilon_rho2_f"]] = rep(0, dim(Return[["Epsiloninput2_sft"]])[2])
# Initial values
if( all(DataList$ObsModel_ez[,2]%in%c(0,3)) ){
Return[["beta1_ct"]] = qlogis(0.01*0.99*tapply(ifelse(DataList$b_i>0,1,0),INDEX=factor(DataList$c_iz[,1],levels=sort(unique(DataList$c_iz[,1]))),FUN=mean)) %o% rep(1,DataList$n_t)
Expand Down
Loading

0 comments on commit 4a8a78d

Please sign in to comment.