Giter Site home page Giter Site logo

Comments (4)

inbokrhee avatar inbokrhee commented on June 20, 2024

I've just filled in any missing values in the legis.data, and it proceeded without the previous error. But now I am getting something else, namely " *** caught segfault *** address 0x7fff2c600d3c, cause 'memory not mapped'". I browsed through stackoverflow and it seems the cause of this type of error can be very diverse..

results = dwnominate(rolls, id = "mpid", polarity = "KABANDO WA KABANDO", minvotes=11)
Running Optimal Classification to get starting estimates...

Preparing to run Optimal Classification...

	Checking data...

		... 197 of 530 total members dropped.

		Votes dropped:
		... 10 of 64 total votes dropped.

	Running Optimal Classification...

		Generating Start Coordinates...
		Running Edith Algorithm...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...
		Getting normal vectors...
		Getting legislator coordinates...


Optimal Classification completed successfully.
Optimal Classification took 4.776 seconds to execute.

Writing DW-NOMINATE input files...

rollcall_input.dat
rollcall_output.dat
legislator_input.dat
legislator_output.dat
session_info.num
rollcall_matrix.vt3
transposed_rollcall_matrix.vt3
NOMINAL DYNAMIC-WEIGHTED MULTIDIMENSIONAL UNFOLDING
    2    1    1    2    1    5
  5.9539  0.3463
 NUMBER OF CONGRESSES     2
 TOTAL ROLL CALLS 01-108      64
 TOTAL LEGISLATORS 01-108    582
 LNL      6937      6937      -4808.363  1.0000  0.5000  1.0000  0.3463  5.9539
 LNL      6937      6937      -4808.363  1.0000  0.5000  1.0000  0.3563  5.9539
 LNL      6937      6937      -4808.363  1.0000  0.5000  1.0000  0.3363  5.9539
 LNL      6937      6937      -4808.363  1.0000  0.5000  1.0000  0.3463  5.9539
 LNL      6937      6937      -4808.363  1.0000  0.5000  1.0000  0.3463  6.0539
 LNL      6937      6937      -4808.363  1.0000  0.5000  1.0000  0.3463  5.8539
 NUMBER RCs & CLASSIFICATION       64       54     6937     5785     5920     2157
                                0.8534  0.5285
 LNL      6937      5920      -2377.753  0.8534  0.7098  1.0000  0.3463  5.9539
 UNIQUE LEGISLATORS   535     0     0     0     6937
                         -1603.204      -1603.204      -1603.204      -1603.204
 LNL      6937      6313      -1603.204  0.9100  0.7937  1.0000  0.3463  5.9539
     6937      -1603.204      -1603.204
 LNL      6937      6313      -1603.204  0.9100  0.7937  1.0000  0.3463  5.9539
 LNL      6937      6304      -1597.150  0.9088  0.7943  1.0000  0.3563  5.9539
 LNL      6937      6307      -1611.619  0.9092  0.7927  1.0000  0.3363  5.9539
 LNL      6937      6304      -1597.150  0.9088  0.7943  1.0000  0.3563  5.9539
 LNL      6937      6293      -1593.417  0.9072  0.7948  1.0000  0.3663  5.9539
      -1593.417      -1593.417
 LNL      6937      6292      -1591.962  0.9070  0.7949  1.0000  0.3763  5.9539
      -1591.962      -1591.962
 LNL      6937      6283      -1592.733  0.9057  0.7949  1.0000  0.3863  5.9539
      -1591.962      -1592.733
 LNL      6937      6287      -1592.073  0.9063  0.7949  1.0000  0.3813  5.9539
      -1591.962      -1592.073
 LNL      6937      6290      -1591.948  0.9067  0.7949  1.0000  0.3788  5.9539
      -1591.948      -1591.948
 LNL      6937      6287      -1592.073  0.9063  0.7949  1.0000  0.3813  5.9539
      -1591.948      -1592.073
 LNL      6937      6289      -1591.992  0.9066  0.7949  1.0000  0.3800  5.9539
      -1591.948      -1591.992
 LNL      6937      6289      -1591.969  0.9066  0.7949  1.0000  0.3794  5.9539
      -1591.948      -1591.969
 LNL      6937      6290      -1591.955  0.9067  0.7949  1.0000  0.3791  5.9539
      -1591.948      -1591.955
 LNL      6937      6290      -1591.952  0.9067  0.7949  1.0000  0.3790  5.9539
      -1591.948      -1591.952
 LNL      6937      6290      -1591.949  0.9067  0.7949  1.0000  0.3789  5.9539
      -1591.948      -1591.949
 LNL      6937      6290      -1591.950  0.9067  0.7949  1.0000  0.3788  5.9539
      -1591.948      -1591.950
 LNL      6937      6290      -1591.949  0.9067  0.7949  1.0000  0.3788  5.9539
      -1591.948      -1591.949
 LNL      6937      6290      -1591.945  0.9067  0.7949  1.0000  0.3788  5.9539
      -1591.945      -1591.945
 LNL      6937      6290      -1591.949  0.9067  0.7949  1.0000  0.3788  5.9539
      -1591.945      -1591.949
 LNL      6937      6290      -1591.945  0.9067  0.7949  1.0000  0.3788  5.9539
 LNL      6937      6290      -1583.979  0.9067  0.7959  1.0000  0.3788  6.0539
 LNL      6937      6290      -1600.530  0.9067  0.7940  1.0000  0.3788  5.8539
 LNL      6937      6290      -1583.979  0.9067  0.7959  1.0000  0.3788  6.0539
 LNL      6937      6290      -1576.601  0.9067  0.7967  1.0000  0.3788  6.1539
      -1576.601      -1576.601
 LNL      6937      6290      -1569.794  0.9067  0.7975  1.0000  0.3788  6.2539
      -1569.794      -1569.794
 LNL      6937      6290      -1563.532  0.9067  0.7982  1.0000  0.3788  6.3539
      -1563.532      -1563.532
 LNL      6937      6290      -1557.802  0.9067  0.7989  1.0000  0.3788  6.4539
      -1557.802      -1557.802
 LNL      6937      6290      -1552.580  0.9067  0.7995  1.0000  0.3788  6.5539
      -1552.580      -1552.580
 LNL      6937      6290      -1547.850  0.9067  0.8000  1.0000  0.3788  6.6539
      -1547.850      -1547.850
 LNL      6937      6290      -1543.597  0.9067  0.8005  1.0000  0.3788  6.7539
      -1543.597      -1543.597
 LNL      6937      6290      -1539.800  0.9067  0.8009  1.0000  0.3788  6.8539
      -1539.800      -1539.800
 LNL      6937      6290      -1536.453  0.9067  0.8013  1.0000  0.3788  6.9539
      -1536.453      -1536.453
 LNL      6937      6290      -1533.529  0.9067  0.8017  1.0000  0.3788  7.0539
      -1533.529      -1533.529
 LNL      6937      6290      -1531.019  0.9067  0.8020  1.0000  0.3788  7.1539
      -1531.019      -1531.019
 LNL      6937      6290      -1528.916  0.9067  0.8022  1.0000  0.3788  7.2539
      -1528.916      -1528.916
 LNL      6937      6290      -1527.194  0.9067  0.8024  1.0000  0.3788  7.3539
      -1527.194      -1527.194
 LNL      6937      6290      -1525.852  0.9067  0.8026  1.0000  0.3788  7.4539
      -1525.852      -1525.852
 LNL      6937      6290      -1524.871  0.9067  0.8027  1.0000  0.3788  7.5539
      -1524.871      -1524.871

 *** caught segfault ***
address 0x7fff2c600d3c, cause 'memory not mapped'

Traceback:
 1: dwnominate(rolls, id = "mpid", polarity = "KABANDO WA KABANDO",     minvotes = 11)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 1
R is aborting now ...
[1]    32624 segmentation fault  R

from dwnominate.

wmay avatar wmay commented on June 20, 2024

The NA's are an issue. I didn't think to handle NA values for the legislator data, so I should fix that.

As for the segfault, my first two questions are:

  1. Did the example with the senate data run for you?
  2. Are you using gfortran 4.8, as described here?

Assuming the example runs and you installed the package with gfortran 4.8, I can look through the fortran code to try to get an idea of where the segfault occurred. Fair warning though, this can be difficult to debug and I don't know if I will be able to give you the answer or how long it'll take me to find it. (Though I will definitely give it a try because these segfaults annoy me.)

Do you really only have 2 congresses in your data? The DW-NOMINATE fortran code won't estimate a dynamic model unless there are at least 5 congresses, so the results, if it runs, should be nearly identical to W-NOMINATE. The wnominate package is much more stable and mature than this one and I definitely recommend it unless you specifically need to estimate a dynamic model.

from dwnominate.

inbokrhee avatar inbokrhee commented on June 20, 2024

Thanks for the quick response!

The senate example did work, but not my own data. And yes, I used gfortran 4.8. But when I used another laptop (also MacOS) later, it did work and gave me output, so it might be that my configuration in this laptop is somehow off.

I currently only have 2 congresses but am in the process of cleaning some more data and adding more. This was more of a learning/trial process for me, and the codes did give me outputs which seems to have some face validity, but as you said they also seem to be very close to W-Nominate. Thanks!

from dwnominate.

wmay avatar wmay commented on June 20, 2024

I made a series of commits that should fix the legis.data NA problem, and hopefully a lot of the segfault problems as well, so I'm going to mark this as closed (unless you find that it still isn't working).

from dwnominate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.