how to add an edgecov() ergmm model term in latentnet package in RHow to sort a dataframe by multiple column(s)How to join (merge) data frames (inner, outer, left, right)How to make a great R reproducible exampleHow to unload a package without restarting RHow can we make xkcd style graphs?R: Estimating model varianceAdding edge attribute to network object with statnet in RHow do I import vertex and edge attributes for a bipartite network in igraph?How to create network with both edges and isolates using statnet/igraphRegression in a loop but get “Error in coef(summary(fit))[2, 4] : subscript out of bounds”

How can I reduce the sound of rain on a range hood vent?

Is it allowed to spend a night in the first entry country before moving to the main destination?

Question on oracles

What is a macro? Difference between macro and function?

Details of video memory access arbitration in Space Invaders

Can you sign using a digital signature itself?

Which resurrection spells are valid to use with the Zealot's 'Warrior of the Gods' Feature?

Is it bad to describe a character long after their introduction?

What's the easiest way for a whole party to be able to communicate with a creature that doesn't know Common?

Why does a brace command group need spaces after the opening brace in POSIX Shell Grammar?

Understanding Lasso Regression's sparsity geometrically

Why did this meteor appear cyan?

When are digital copies of Switch games made available to play?

What does Mildred mean by this line in Three Billboards Outside Ebbing, Missouri?

Questions about authorship rank and academic politics

Can I ask to speak to my future colleagues before accepting an offer?

Miss Toad and her frogs

How to expand abbrevs without hitting another extra key?

How was film developed in the late 1920s?

Where can I get macOS Catalina Beta version?

Should I report a leak of confidential HR information?

Spicket or spigot?

What is the line crossing the Pacific Ocean that is shown on maps?

What are good ways to spray paint a QR code on a footpath?



how to add an edgecov() ergmm model term in latentnet package in R


How to sort a dataframe by multiple column(s)How to join (merge) data frames (inner, outer, left, right)How to make a great R reproducible exampleHow to unload a package without restarting RHow can we make xkcd style graphs?R: Estimating model varianceAdding edge attribute to network object with statnet in RHow do I import vertex and edge attributes for a bipartite network in igraph?How to create network with both edges and isolates using statnet/igraphRegression in a loop but get “Error in coef(summary(fit))[2, 4] : subscript out of bounds”






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a temporal bipartite network of authors and topics, I am making a ML model which includes a term which must represent the edge persistence feature.
I am using latentnet package in R.



So, i have added a network attribute named "edge_persistence" and am trying to add a edgecov() term. I am getting this error when i include this edgecov() term.




Error in xa[cbind(pl$xmat[, 1:2, drop = FALSE], k)] <- pl$xmat[, k +
2] : subscript out of bounds




Here is the partial source code:



#creating the network
net <- network(year_matrix, vertex.attr = NULL, vertex.attrnames = NULL, directed = FALSE, hyper = FALSE, loops = FALSE, multiple = FALSE, bipartite = 2)

#calculating the number of edges
no_of_edges = 0
for(i in c(1:length(author_nodes)))

for(j in c(1:length(topic_nodes)))

no_of_edges = no_of_edges+1



#forming the edge_persistance_vector
edge_persistance_vector <- vector("numeric", no_of_edges)
temp_itr=1
for(i in c(1:length(author_nodes)))

for(j in c(1:length(topic_nodes)))

if(year_matrix[i, j]==1)

if(prev_year_matrix[i, j]==1)

edge_persistance_vector[temp_itr] = 1

else

edge_persistance_vector[temp_itr] = 0


else

edge_persistance_vector[temp_itr] = 0

temp_itr = temp_itr+1



#adding the network attribute
set.network.attribute(net, attrname = "edge_persistance", value = edge_persistance_vector)

#making the model
ergmm_result <- ergmm(formula = net ~ euclidean(d=2, G=3) + rsociality(var=1, var.df=3) + edgecov("edge_persistance"), verbose = TRUE)



And here is the error which I am getting if I include the edgecov("edge_persistance") term




Error in xa[cbind(pl$xmat[, 1:2, drop = FALSE], k)] <- pl$xmat[, k +
2] : subscript out of bounds




Can someone please suggest how I can resolve this "subscript out of bounds" error?
Thanks in advance!!










share|improve this question






























    0















    I have a temporal bipartite network of authors and topics, I am making a ML model which includes a term which must represent the edge persistence feature.
    I am using latentnet package in R.



    So, i have added a network attribute named "edge_persistence" and am trying to add a edgecov() term. I am getting this error when i include this edgecov() term.




    Error in xa[cbind(pl$xmat[, 1:2, drop = FALSE], k)] <- pl$xmat[, k +
    2] : subscript out of bounds




    Here is the partial source code:



    #creating the network
    net <- network(year_matrix, vertex.attr = NULL, vertex.attrnames = NULL, directed = FALSE, hyper = FALSE, loops = FALSE, multiple = FALSE, bipartite = 2)

    #calculating the number of edges
    no_of_edges = 0
    for(i in c(1:length(author_nodes)))

    for(j in c(1:length(topic_nodes)))

    no_of_edges = no_of_edges+1



    #forming the edge_persistance_vector
    edge_persistance_vector <- vector("numeric", no_of_edges)
    temp_itr=1
    for(i in c(1:length(author_nodes)))

    for(j in c(1:length(topic_nodes)))

    if(year_matrix[i, j]==1)

    if(prev_year_matrix[i, j]==1)

    edge_persistance_vector[temp_itr] = 1

    else

    edge_persistance_vector[temp_itr] = 0


    else

    edge_persistance_vector[temp_itr] = 0

    temp_itr = temp_itr+1



    #adding the network attribute
    set.network.attribute(net, attrname = "edge_persistance", value = edge_persistance_vector)

    #making the model
    ergmm_result <- ergmm(formula = net ~ euclidean(d=2, G=3) + rsociality(var=1, var.df=3) + edgecov("edge_persistance"), verbose = TRUE)



    And here is the error which I am getting if I include the edgecov("edge_persistance") term




    Error in xa[cbind(pl$xmat[, 1:2, drop = FALSE], k)] <- pl$xmat[, k +
    2] : subscript out of bounds




    Can someone please suggest how I can resolve this "subscript out of bounds" error?
    Thanks in advance!!










    share|improve this question


























      0












      0








      0








      I have a temporal bipartite network of authors and topics, I am making a ML model which includes a term which must represent the edge persistence feature.
      I am using latentnet package in R.



      So, i have added a network attribute named "edge_persistence" and am trying to add a edgecov() term. I am getting this error when i include this edgecov() term.




      Error in xa[cbind(pl$xmat[, 1:2, drop = FALSE], k)] <- pl$xmat[, k +
      2] : subscript out of bounds




      Here is the partial source code:



      #creating the network
      net <- network(year_matrix, vertex.attr = NULL, vertex.attrnames = NULL, directed = FALSE, hyper = FALSE, loops = FALSE, multiple = FALSE, bipartite = 2)

      #calculating the number of edges
      no_of_edges = 0
      for(i in c(1:length(author_nodes)))

      for(j in c(1:length(topic_nodes)))

      no_of_edges = no_of_edges+1



      #forming the edge_persistance_vector
      edge_persistance_vector <- vector("numeric", no_of_edges)
      temp_itr=1
      for(i in c(1:length(author_nodes)))

      for(j in c(1:length(topic_nodes)))

      if(year_matrix[i, j]==1)

      if(prev_year_matrix[i, j]==1)

      edge_persistance_vector[temp_itr] = 1

      else

      edge_persistance_vector[temp_itr] = 0


      else

      edge_persistance_vector[temp_itr] = 0

      temp_itr = temp_itr+1



      #adding the network attribute
      set.network.attribute(net, attrname = "edge_persistance", value = edge_persistance_vector)

      #making the model
      ergmm_result <- ergmm(formula = net ~ euclidean(d=2, G=3) + rsociality(var=1, var.df=3) + edgecov("edge_persistance"), verbose = TRUE)



      And here is the error which I am getting if I include the edgecov("edge_persistance") term




      Error in xa[cbind(pl$xmat[, 1:2, drop = FALSE], k)] <- pl$xmat[, k +
      2] : subscript out of bounds




      Can someone please suggest how I can resolve this "subscript out of bounds" error?
      Thanks in advance!!










      share|improve this question
















      I have a temporal bipartite network of authors and topics, I am making a ML model which includes a term which must represent the edge persistence feature.
      I am using latentnet package in R.



      So, i have added a network attribute named "edge_persistence" and am trying to add a edgecov() term. I am getting this error when i include this edgecov() term.




      Error in xa[cbind(pl$xmat[, 1:2, drop = FALSE], k)] <- pl$xmat[, k +
      2] : subscript out of bounds




      Here is the partial source code:



      #creating the network
      net <- network(year_matrix, vertex.attr = NULL, vertex.attrnames = NULL, directed = FALSE, hyper = FALSE, loops = FALSE, multiple = FALSE, bipartite = 2)

      #calculating the number of edges
      no_of_edges = 0
      for(i in c(1:length(author_nodes)))

      for(j in c(1:length(topic_nodes)))

      no_of_edges = no_of_edges+1



      #forming the edge_persistance_vector
      edge_persistance_vector <- vector("numeric", no_of_edges)
      temp_itr=1
      for(i in c(1:length(author_nodes)))

      for(j in c(1:length(topic_nodes)))

      if(year_matrix[i, j]==1)

      if(prev_year_matrix[i, j]==1)

      edge_persistance_vector[temp_itr] = 1

      else

      edge_persistance_vector[temp_itr] = 0


      else

      edge_persistance_vector[temp_itr] = 0

      temp_itr = temp_itr+1



      #adding the network attribute
      set.network.attribute(net, attrname = "edge_persistance", value = edge_persistance_vector)

      #making the model
      ergmm_result <- ergmm(formula = net ~ euclidean(d=2, G=3) + rsociality(var=1, var.df=3) + edgecov("edge_persistance"), verbose = TRUE)



      And here is the error which I am getting if I include the edgecov("edge_persistance") term




      Error in xa[cbind(pl$xmat[, 1:2, drop = FALSE], k)] <- pl$xmat[, k +
      2] : subscript out of bounds




      Can someone please suggest how I can resolve this "subscript out of bounds" error?
      Thanks in advance!!







      r social-networking statnet






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 25 at 12:37









      jacky_learns_to_code

      4972 gold badges7 silver badges21 bronze badges




      4972 gold badges7 silver badges21 bronze badges










      asked Mar 25 at 12:21









      Bhanu vikas YagantiBhanu vikas Yaganti

      44 bronze badges




      44 bronze badges






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337678%2fhow-to-add-an-edgecov-ergmm-model-term-in-latentnet-package-in-r%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.








          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.




















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337678%2fhow-to-add-an-edgecov-ergmm-model-term-in-latentnet-package-in-r%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현